diff options
Diffstat (limited to 'src-qt5/core/libLumina')
-rw-r--r-- | src-qt5/core/libLumina/LIconCache.cpp | 13 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaXDG.cpp | 9 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src-qt5/core/libLumina/LIconCache.cpp b/src-qt5/core/libLumina/LIconCache.cpp index 9d122df7..bb81bc47 100644 --- a/src-qt5/core/libLumina/LIconCache.cpp +++ b/src-qt5/core/libLumina/LIconCache.cpp @@ -55,9 +55,9 @@ QString LIconCache::findFile(QString icon){ if(icon.isEmpty()){ return ""; } //Get the currently-set theme QString cTheme = QIcon::themeName(); - if(cTheme.isEmpty()){ - QIcon::setThemeName("material-design-light"); - cTheme = "material-design-light"; + if(cTheme.isEmpty()){ + QIcon::setThemeName("material-design-light"); + cTheme = "material-design-light"; } //Make sure the current search paths correspond to this theme if( QDir::searchPaths("icontheme").filter("/"+cTheme+"/").isEmpty() ){ @@ -309,7 +309,12 @@ bool LIconCache::isThemeIcon(QString id){ } QIcon LIconCache::iconFromTheme(QString id){ - return QIcon::fromTheme(id); + QIcon ico = QIcon::fromTheme(id); + if(ico.isNull()){ + //icon missing in theme? run the old icon-finder system + ico = QIcon(findFile(id)); + } + return ico; } // === PRIVATE SLOTS === diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index fed998a2..01b3305e 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -747,9 +747,12 @@ void LXDG::setEnvironmentVars(){ QIcon LXDG::findIcon(QString iconName, QString fallback){ //With the addition of the Lumina theme engine (8/3/17), switch back to using the Qt icon from theme method for apps - QIcon tmp = QIcon::fromTheme(iconName); - if(tmp.isNull()){ tmp = QIcon::fromTheme(fallback); } - return tmp; + QIcon tmp; + if(!iconName.contains("libreoffice")){ //libreoffice is stupid - their svg icons are un-renderable with Qt + tmp = QIcon::fromTheme(iconName); + if(tmp.isNull()){ tmp = QIcon::fromTheme(fallback); } + } + if(!tmp.isNull()){ return tmp; } //found one in the theme //NOTE: This was re-written on 11/10/15 to avoid using the QIcon::fromTheme() framework |