aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaThemes.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2014-10-04 15:13:12 -0400
committerKen Moore <ken@pcbsd.org>2014-10-04 15:13:12 -0400
commit5f59a88e3f9104a44b6be0cfbe56063e2deb6afe (patch)
tree89207ac4713357baa55d5eac63f961bf413a6851 /libLumina/LuminaThemes.cpp
parentMake sure to initialize the QApplication before trying to show the error box ... (diff)
downloadlumina-5f59a88e3f9104a44b6be0cfbe56063e2deb6afe.tar.gz
lumina-5f59a88e3f9104a44b6be0cfbe56063e2deb6afe.tar.bz2
lumina-5f59a88e3f9104a44b6be0cfbe56063e2deb6afe.zip
Add the template for the new LuminaThemes library class (not integrated into build yet).
This class will provide a consistant look for all Lumina utilities, while also allowing the user ways to easily modify the themes/appearance and have it take effect immediately. I also plan on extending this framework to save the completed stylesheet for *all* Qt-based system applications to use (providing an easy way to customize the feel of the system).
Diffstat (limited to 'libLumina/LuminaThemes.cpp')
-rw-r--r--libLumina/LuminaThemes.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/libLumina/LuminaThemes.cpp b/libLumina/LuminaThemes.cpp
new file mode 100644
index 00000000..d1869ae4
--- /dev/null
+++ b/libLumina/LuminaThemes.cpp
@@ -0,0 +1,75 @@
+//===========================================
+// Lumina-DE source code
+// Copyright (c) 2014, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+#include "LuminaThemes.h"
+
+#include "LuminaUtils.h"
+#include "LuminaOS.h"
+
+QStringList LTHEME::availableSystemThemes(){
+ //returns: [name::::path] for each item
+
+}
+
+QStringList LTHEME::availableLocalThemes(){ //returns: [name::::path] for each item
+
+}
+
+QStringList LTHEME::availableSystemColors(){ //returns: [name::::path] for each item
+
+}
+
+QStringList LTHEME::availableLocalColors(){ //returns: [name::::path] for each item
+
+}
+
+QStringList LTHEME::availableSystemIcons(){ //returns: [name] for each item
+
+}
+
+ //Return the currently selected Theme/Colors/Icons
+QStringList LTHEME::currentSettings(){ //returns [theme path, colorspath, iconsname]
+
+}
+
+ //Change the current Theme/Colors/Icons
+bool LTHEME::setCurrentSettings(QString themepath, QString colorpath, QString iconname){
+
+}
+
+ //Return the complete stylesheet for a given theme/colors
+QString LTHEME::assembleStyleSheet(QString themepath, QString colorpath){
+
+}
+
+//==================
+// THEME ENGINE CLASS
+//==================
+LuminaThemeEngine::LuminaThemeEngine(QApplication *app){
+ application=app; //save this pointer for later
+ QStringList current = LTHEME::currentSettings();
+ theme = current[0]; colors=current[1]; icons=current[2];
+ application->setCurrentStyleSheet( LTHEME::assembleStyleSheet(theme, colors) );
+ watcher = new QFileSystemWatcher(this);
+ watcher->addPath( QDir::homePath()+"/.lumina/currenttheme.conf" );
+ connect(watcher, SIGNAL(fileChanged(const &QString)), this, SLOT(watcherChange()) );
+}
+
+LuminaThemeEngine::~LuminaThemeEngine(){
+
+}
+
+void LuminaThemeEngine::watcherChange(){
+ QStringList current = LTHEME::currentSettings();
+ if(theme!=current[0] || colors!=current[1]){
+ application->setCurrentStyleSheet( LTHEME::assembleStyleSheet(current[0], current[1]) );
+ }
+ if(icons!=current[3]){
+ emit updateIcons();
+ }
+ //Now save this for later checking
+ theme = current[0]; colors=current[1]; icons=current[2];
+}
bgstack15