aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-04-13 12:17:02 +0000
committerWeblate <noreply@weblate.org>2017-04-13 12:17:02 +0000
commit724c696b78bace3d5538ebc1b69d9b683fda4b3e (patch)
treeabd5ddb07c292ed2e2ed0393d690c4a49becbce6 /src-qt5/core
parentTranslated using Weblate (lumina_CONFIG@sv (generated)) (diff)
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-724c696b78bace3d5538ebc1b69d9b683fda4b3e.tar.gz
lumina-724c696b78bace3d5538ebc1b69d9b683fda4b3e.tar.bz2
lumina-724c696b78bace3d5538ebc1b69d9b683fda4b3e.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core')
-rw-r--r--src-qt5/core/libLumina/LuminaThemes.cpp3
-rw-r--r--src-qt5/core/libLumina/LuminaXDG.cpp21
-rw-r--r--src-qt5/core/libLumina/LuminaXDG.h1
-rw-r--r--src-qt5/core/libLumina/RootSubWindow.cpp2
4 files changed, 25 insertions, 2 deletions
diff --git a/src-qt5/core/libLumina/LuminaThemes.cpp b/src-qt5/core/libLumina/LuminaThemes.cpp
index 70cd221d..85d43925 100644
--- a/src-qt5/core/libLumina/LuminaThemes.cpp
+++ b/src-qt5/core/libLumina/LuminaThemes.cpp
@@ -83,7 +83,8 @@ QStringList LTHEME::availableSystemIcons(){ //returns: [name] for each item
tmpthemes = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
for(int j=0; j<tmpthemes.length(); j++){
if(tmpthemes[j].startsWith("default")){ continue; }
- if(QFile::exists(dir.absoluteFilePath(tmpthemes[j]+"/index.theme")) ){ themes << tmpthemes[j]; }
+ if(QFile::exists(dir.absoluteFilePath(tmpthemes[j]+"/index.theme")) ||
+ QFile::exists(dir.absoluteFilePath(tmpthemes[j]+"/index.desktop")) ){ themes << tmpthemes[j]; }
}
}
}
diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp
index 3694916b..db1f5a97 100644
--- a/src-qt5/core/libLumina/LuminaXDG.cpp
+++ b/src-qt5/core/libLumina/LuminaXDG.cpp
@@ -780,11 +780,15 @@ QIcon LXDG::findIcon(QString iconName, QString fallback){
}
//Now load all the dirs into the search paths
QStringList theme, oxy, fall;
+ QStringList themedeps = getIconThemeDepChain(cTheme, paths);
for(int i=0; i<paths.length(); i++){
theme << getChildIconDirs( paths[i]+cTheme);
+ for(int j=0; j<themedeps.length(); j++){ theme << getChildIconDirs(paths[i]+themedeps[j]); }
oxy << getChildIconDirs(paths[i]+"material-design-light"); //Lumina base icon set
fall << getChildIconDirs(paths[i]+"hicolor"); //XDG fallback (apps add to this)
}
+ //Now load all the icon theme dependencies in order (Theme1 -> Theme2 -> Theme3 -> Fallback)
+
//fall << LOS::AppPrefix()+"share/pixmaps"; //always use this as well as a final fallback
QDir::setSearchPaths("icontheme", theme);
QDir::setSearchPaths("material-design-light", oxy);
@@ -884,6 +888,23 @@ QStringList LXDG::getChildIconDirs(QString parent){
return out;
}
+QStringList LXDG::getIconThemeDepChain(QString theme, QStringList paths){
+ QStringList results;
+ for(int i=0; i<paths.length(); i++){
+ if( QFile::exists(paths[i]+theme+"/index.theme") ){
+ QStringList deps = LUtils::readFile(paths[i]+theme+"/index.theme").filter("Inherits=");
+ if(!deps.isEmpty()){
+ deps = deps.first().section("=",1,-1).split(";",QString::SkipEmptyParts);
+ for(int j=0; j<deps.length(); j++){
+ results << deps[j] << getIconThemeDepChain(deps[j],paths);
+ }
+ }
+ break; //found primary theme index file - stop here
+ }
+ }
+ return results;;
+}
+
QStringList LXDG::systemMimeDirs(){
//Returns a list of all the directories where *.xml MIME files can be found
QStringList appDirs = QString(getenv("XDG_DATA_HOME")).split(":");
diff --git a/src-qt5/core/libLumina/LuminaXDG.h b/src-qt5/core/libLumina/LuminaXDG.h
index fbfd6fd4..d159ef43 100644
--- a/src-qt5/core/libLumina/LuminaXDG.h
+++ b/src-qt5/core/libLumina/LuminaXDG.h
@@ -187,6 +187,7 @@ public:
static QIcon findIcon(QString iconName, QString fallback = "");
//Recursivly compile a list of child directories with *.png files in them
static QStringList getChildIconDirs(QString parent);
+ static QStringList getIconThemeDepChain(QString theme, QStringList paths);
//List all the mime-type directories
static QStringList systemMimeDirs();
//Find the mime-type icon for a particular file extension
diff --git a/src-qt5/core/libLumina/RootSubWindow.cpp b/src-qt5/core/libLumina/RootSubWindow.cpp
index ba682077..688a1d07 100644
--- a/src-qt5/core/libLumina/RootSubWindow.cpp
+++ b/src-qt5/core/libLumina/RootSubWindow.cpp
@@ -23,7 +23,7 @@ RootSubWindow::RootSubWindow(QWidget *root, NativeWindow *win) : QFrame(root){
initWindowFrame();
LoadProperties( NativeWindow::allProperties() );
//Hookup the signals/slots
- connect(WIN, SIGNAL(PropertiesChanged(QList<NativeWindow::Property>, QList<QVariant>)), this, SLOT(PropertiesChanged(QList<NativeWindow::Property>, QList<QVariant>)));
+ connect(WIN, SIGNAL(PropertiesChanged(QList<NativeWindow::Property>, QList<QVariant>)), this, SLOT(propertiesChanged(QList<NativeWindow::Property>, QList<QVariant>)));
}
RootSubWindow::~RootSubWindow(){
bgstack15