mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-11 17:28:36 +12: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 "localized.h"
|
||||||
|
|
||||||
#include "Emu/System.h"
|
#include "Emu/System.h"
|
||||||
|
#include "Utilities/File.h"
|
||||||
|
#include "Utilities/StrUtil.h"
|
||||||
|
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
@ -376,7 +378,17 @@ QString gui_settings::GetCurrentStylesheetPath()
|
||||||
QString path = dir.absoluteFilePath(stylesheet + ".qss");
|
QString path = dir.absoluteFilePath(stylesheet + ".qss");
|
||||||
QFile test(path);
|
QFile test(path);
|
||||||
if (test.exists())
|
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 "";
|
return "";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue