mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00:00
Qt: fix stylesheets on various platforms
Replace relative paths to resources. Paths should start from GuiConfigs.
This commit is contained in:
parent
0057c89eaa
commit
632e36ab44
1 changed files with 13 additions and 1 deletions
|
@ -4,6 +4,8 @@
|
|||
#include "localized.h"
|
||||
|
||||
#include "Emu/System.h"
|
||||
#include "Utilities/File.h"
|
||||
#include "Utilities/StrUtil.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QCoreApplication>
|
||||
|
@ -376,7 +378,17 @@ QString gui_settings::GetCurrentStylesheetPath()
|
|||
QString path = dir.absoluteFilePath(stylesheet + ".qss");
|
||||
QFile test(path);
|
||||
if (test.exists())
|
||||
return path;
|
||||
{
|
||||
test.open(QIODevice::ReadOnly);
|
||||
std::string result = fs::get_cache_dir() + "temp.qss";
|
||||
std::string sheet = test.readAll().toStdString();
|
||||
|
||||
// Fixup paths (replace resources in GuiConfigs with absolute paths) and store in temp file.
|
||||
path.truncate(path.size() - stylesheet.size() - 4);
|
||||
fs::write_file(result, fs::rewrite, fmt::replace_all(sheet, "url(\"GuiConfigs/", "url(\"" + path.toStdString()));
|
||||
|
||||
return QString::fromUtf8(result.data(), result.size());
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
|
|
Loading…
Add table
Reference in a new issue