diff options
author | Ken Moore <ken@ixsystems.com> | 2017-08-03 13:36:21 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-08-03 14:04:05 -0400 |
commit | 767e04875146b081f0956805fd7d2932304441d0 (patch) | |
tree | 534e301285bd918788f5ccae99eb618353f63038 /src-qt5/core/libLumina/LuminaXDG.cpp | |
parent | Fix up a bit more of the lumina-theme-engine (diff) | |
download | lumina-767e04875146b081f0956805fd7d2932304441d0.tar.gz lumina-767e04875146b081f0956805fd7d2932304441d0.tar.bz2 lumina-767e04875146b081f0956805fd7d2932304441d0.zip |
Get the icon loading routines all switched over to the old QIcon::fromTheme() routine now that we have a theme engine available out-of-box.
Diffstat (limited to 'src-qt5/core/libLumina/LuminaXDG.cpp')
-rw-r--r-- | src-qt5/core/libLumina/LuminaXDG.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index 8da39564..fed998a2 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -723,7 +723,7 @@ QList<XDGDesktop*> LXDG::sortDesktopNames(QList<XDGDesktop*> apps){ //Sort the list by name of the application QHash<QString, XDGDesktop*> sorter; for(int i=0; i<apps.length(); i++){ - sorter.insert(apps[i]->name.toLower(), apps[i]); + sorter.insert(apps[i]->name.toLower(), apps[i]); } QStringList keys = sorter.keys(); keys.sort(); @@ -746,16 +746,22 @@ 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; + + //NOTE: This was re-written on 11/10/15 to avoid using the QIcon::fromTheme() framework // -- Too many issues with SVG files and/or search paths with the built-in system - + //Check if the icon is an absolute path and exists bool DEBUG =false; if(DEBUG){ qDebug() << "[LXDG] Find icon for:" << iconName; } if(QFile::exists(iconName) && iconName.startsWith("/")){ return QIcon(iconName); } else if(iconName.startsWith("/")){ iconName.section("/",-1); } //Invalid absolute path, just look for the icon //Check if the icon is actually given - if(iconName.isEmpty()){ + if(iconName.isEmpty()){ if(fallback.isEmpty()){ return QIcon(); } else{ return LXDG::findIcon(fallback, ""); } } @@ -763,9 +769,9 @@ QIcon LXDG::findIcon(QString iconName, QString fallback){ if(DEBUG){ qDebug() << "[LXDG] Start search for icon"; } //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() ){ |