Merge pull request #3156 from PrismLauncher/backport-3152-to-release-9.x

[Backport release-9.x] Fix system icons on Linux
This commit is contained in:
Tayou 2024-12-02 15:02:21 +01:00 committed by GitHub
commit cdfd0b1002
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View File

@ -1,7 +1,6 @@
[Icon Theme]
Name=Legacy
Comment=Default Icons
Inherits=default
Directories=8x8,16x16,22x22,24x24,32x32,32x32/instances,48x48,50x50/instances,64x64,128x128/instances,256x256,scalable,scalable/instances
[8x8]

View File

@ -36,6 +36,8 @@
ThemeManager::ThemeManager()
{
QIcon::setFallbackThemeName(QIcon::themeName());
QIcon::setFallbackSearchPaths(QIcon::themeSearchPaths());
themeDebugLog() << "Determining System Widget Theme...";
const auto& style = QApplication::style();
m_defaultStyle = style->objectName();
@ -93,9 +95,7 @@ void ThemeManager::initializeIcons()
// set icon theme search path!
themeDebugLog() << "<> Initializing Icon Themes";
auto searchPaths = QIcon::themeSearchPaths();
searchPaths.append(m_iconThemeFolder.path());
QIcon::setThemeSearchPaths(searchPaths);
QIcon::setThemeSearchPaths({ m_iconThemeFolder.path(), ":/icons" });
for (const QString& id : builtinIcons) {
IconTheme theme(id, QString(":/icons/%1").arg(id));