From 6662b1ab518751d4f1f9f3b0295189f8e7c1d371 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 12 Apr 2017 09:04:47 -0400 Subject: Add an additional icon search fallback for mimetype icons (use the *-x-generic icon) --- src-qt5/core/libLumina/LuminaXDG.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src-qt5/core') diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index f34bc0e8..d17cc330 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -843,8 +843,12 @@ QIcon LXDG::findIcon(QString iconName, QString fallback){ } } //Use the fallback icon if necessary - if(ico.isNull() && !fallback.isEmpty()){ - ico = LXDG::findIcon(fallback,""); + if(ico.isNull() ){ + if(!fallback.isEmpty()){ ico = LXDG::findIcon(fallback,""); } + else if(iconName.contains("-x-") && !iconName.endsWith("-x-generic")){ + //mimetype - try to use the generic type icon + ico = LXDG::findIcon(iconName.section("-x-",0,0)+"-x-generic", ""); + } } if(ico.isNull()){ qDebug() << "Could not find icon:" << iconName << fallback; -- cgit From 6dc51fb62b13b5931800851a3680508a13b1403f Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 12 Apr 2017 16:07:11 -0400 Subject: Turn on the new icon theme for Lumina, and use it by default as the fallback icon set (no longer rely on the "oxygen" icon set). --- src-qt5/core/core.pro | 3 ++- src-qt5/core/libLumina/LuminaXDG.cpp | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src-qt5/core') diff --git a/src-qt5/core/core.pro b/src-qt5/core/core.pro index 27aff3a2..4878b1f3 100644 --- a/src-qt5/core/core.pro +++ b/src-qt5/core/core.pro @@ -7,7 +7,8 @@ CONFIG += recursive SUBDIRS+= lumina-desktop \ lumina-session \ lumina-open \ - lumina-info + lumina-info \ + $${PWD}/../../icon-theme # lumina-wm-INCOMPLETE \ # lumina-checkpass diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index d17cc330..3694916b 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -764,12 +764,12 @@ QIcon LXDG::findIcon(QString iconName, QString fallback){ //Get the currently-set theme QString cTheme = QIcon::themeName(); if(cTheme.isEmpty()){ - QIcon::setThemeName("oxygen"); - cTheme = "oxygen"; + 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() ){ - //Need to reset search paths: setup the "icontheme" "oxygen" and "fallback" sets + //Need to reset search paths: setup the "icontheme" "material-design-light" and "fallback" sets // - Get all the base icon directories QStringList paths; paths << QDir::homePath()+"/.icons/"; //ordered by priority - local user dirs first @@ -782,18 +782,18 @@ QIcon LXDG::findIcon(QString iconName, QString fallback){ QStringList theme, oxy, fall; for(int i=0; i