mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 12:32:43 +00:00
Make loading StyleSheets work for AppImages and if installed via make install
This commit is contained in:
parent
da9baac842
commit
8c19ff4fb9
@ -375,6 +375,20 @@ void rpcs3_app::OnChangeStyleSheetRequest(const QString& sheetFilePath)
|
|||||||
setStyleSheet(file.readAll());
|
setStyleSheet(file.readAll());
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// If we can't open the file, try the /share folder
|
||||||
|
QString shareDir = QCoreApplication::applicationDirPath() + "/../share/rpcs3/";
|
||||||
|
QDir::setCurrent(shareDir);
|
||||||
|
QFile newFile(shareDir + "GuiConfigs/" + QFileInfo(file.fileName()).fileName());
|
||||||
|
if (newFile.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||||
|
{
|
||||||
|
setStyleSheet(newFile.readAll());
|
||||||
|
newFile.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
gui::stylesheet = styleSheet();
|
gui::stylesheet = styleSheet();
|
||||||
RPCS3MainWin->RepaintGui();
|
RPCS3MainWin->RepaintGui();
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "gui_settings.h"
|
#include "gui_settings.h"
|
||||||
|
|
||||||
#include "game_list_frame.h"
|
#include "game_list_frame.h"
|
||||||
|
#include "qt_utils.h"
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@ -235,15 +236,15 @@ void gui_settings::BackupSettingsToTarget(const QString& friendlyName)
|
|||||||
|
|
||||||
QStringList gui_settings::GetStylesheetEntries()
|
QStringList gui_settings::GetStylesheetEntries()
|
||||||
{
|
{
|
||||||
QStringList nameFilter;
|
QStringList nameFilter = QStringList("*.qss");
|
||||||
nameFilter << "*.qss";
|
QStringList res = gui::utils::get_dir_entries(m_settingsDir, nameFilter);
|
||||||
QFileInfoList entries = m_settingsDir.entryInfoList(nameFilter, QDir::Files);
|
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||||
QStringList res;
|
// Makes stylesheets load if using AppImage or installed to /usr/bin
|
||||||
for (const QFileInfo &entry : entries)
|
QDir linuxStylesheetDir = QCoreApplication::applicationDirPath() + "/../share/rpcs3/GuiConfigs/";
|
||||||
{
|
res.append(gui::utils::get_dir_entries(linuxStylesheetDir, nameFilter));
|
||||||
res.append(entry.baseName());
|
res.removeDuplicates();
|
||||||
}
|
#endif
|
||||||
|
res.sort(Qt::CaseInsensitive);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user