diff options
Diffstat (limited to 'lumina-config')
-rw-r--r-- | lumina-config/main.cpp | 3 | ||||
-rw-r--r-- | lumina-config/mainUI.cpp | 61 | ||||
-rw-r--r-- | lumina-config/mainUI.h | 5 | ||||
-rw-r--r-- | lumina-config/mainUI.ui | 139 |
4 files changed, 188 insertions, 20 deletions
diff --git a/lumina-config/main.cpp b/lumina-config/main.cpp index 415a3c85..27af600d 100644 --- a/lumina-config/main.cpp +++ b/lumina-config/main.cpp @@ -9,6 +9,7 @@ #include "mainUI.h" #include <LuminaOS.h> +#include <LuminaThemes.h> int main(int argc, char ** argv) { @@ -19,6 +20,7 @@ int main(int argc, char ** argv) if( a.isRunning() ) return !(a.sendMessage("show")); #endif + LuminaThemeEngine theme(&a); QTranslator translator; QLocale mylocale; QString langCode = mylocale.name(); @@ -31,6 +33,7 @@ int main(int argc, char ** argv) MainUI w; QObject::connect(&a, SIGNAL(messageReceived(const QString&)), &w, SLOT(slotSingleInstance()) ); + QObject::connect(&theme, SIGNAL(updateIcons()), &w, SLOT(setupIcons()) ); w.show(); int retCode = a.exec(); diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp index df4b4d11..b9c83f42 100644 --- a/lumina-config/mainUI.cpp +++ b/lumina-config/mainUI.cpp @@ -118,6 +118,8 @@ void MainUI::setupIcons(){ ui->tool_session_addapp->setIcon( LXDG::findIcon("system-run","") ); ui->tool_session_addbin->setIcon( LXDG::findIcon("system-search","") ); ui->tool_session_addfile->setIcon( LXDG::findIcon("run-build-file","") ); + ui->tool_session_newtheme->setIcon( LXDG::findIcon("preferences-desktop-theme","") ); + ui->tool_session_newcolor->setIcon( LXDG::findIcon("preferences-desktop-color","") ); } @@ -198,6 +200,12 @@ void MainUI::setupConnections(){ connect(ui->check_session_playlogoutaudio, SIGNAL(stateChanged(int)), this, SLOT(sessionoptchanged()) ); connect(ui->spin_session_wkspaces, SIGNAL(valueChanged(int)), this, SLOT(sessionoptchanged()) ); connect(ui->list_session_start, SIGNAL(currentRowChanged(int)), this, SLOT(sessionstartchanged()) ); + connect(ui->spin_session_fontsize, SIGNAL(valueChanged(int)), this, SLOT(sessionoptchanged()) ); + connect(ui->combo_session_themefile, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) ); + connect(ui->combo_session_colorfile, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) ); + connect(ui->combo_session_icontheme, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) ); + connect(ui->font_session_theme, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) ); + } void MainUI::setupMenus(){ @@ -1365,6 +1373,51 @@ void MainUI::loadSessionSettings(){ ui->check_session_playloginaudio->setChecked( sessionsettings->value("PlayStartupAudio",true).toBool() ); ui->check_session_playlogoutaudio->setChecked( sessionsettings->value("PlayLogoutAudio",true).toBool() ); + //Now do the session theme options + ui->combo_session_themefile->clear(); + ui->combo_session_colorfile->clear(); + ui->combo_session_icontheme->clear(); + QStringList current = LTHEME::currentSettings(); + // - local theme templates + QStringList tmp = LTHEME::availableLocalThemes(); + tmp.sort(); + for(int i=0; i<tmp.length(); i++){ + ui->combo_session_themefile->addItem(tmp[i].section("::::",0,0)+" ("+tr("Local")+")", tmp[i].section("::::",1,1)); + if(tmp[i].section("::::",1,1)==current[0]){ ui->combo_session_themefile->setCurrentIndex(i); } + } + // - system theme templates + tmp = LTHEME::availableSystemThemes(); + tmp.sort(); + for(int i=0; i<tmp.length(); i++){ + ui->combo_session_themefile->addItem(tmp[i].section("::::",0,0)+" ("+tr("System")+")", tmp[i].section("::::",1,1)); + if(tmp[i].section("::::",1,1)==current[0]){ ui->combo_session_themefile->setCurrentIndex(i); } + } + // - local color schemes + tmp = LTHEME::availableLocalColors(); + tmp.sort(); + for(int i=0; i<tmp.length(); i++){ + ui->combo_session_colorfile->addItem(tmp[i].section("::::",0,0)+" ("+tr("Local")+")", tmp[i].section("::::",1,1)); + if(tmp[i].section("::::",1,1)==current[1]){ ui->combo_session_colorfile->setCurrentIndex(i); } + } + // - system color schemes + tmp = LTHEME::availableSystemColors(); + tmp.sort(); + for(int i=0; i<tmp.length(); i++){ + ui->combo_session_colorfile->addItem(tmp[i].section("::::",0,0)+" ("+tr("System")+")", tmp[i].section("::::",1,1)); + if(tmp[i].section("::::",1,1)==current[1]){ ui->combo_session_colorfile->setCurrentIndex(i); } + } + // - icon themes + tmp = LTHEME::availableSystemIcons(); + tmp.sort(); + for(int i=0; i<tmp.length(); i++){ + ui->combo_session_icontheme->addItem(tmp[i]); + if(tmp[i]==current[2]){ ui->combo_session_icontheme->setCurrentIndex(i); } + } + // - Font + ui->font_session_theme->setCurrentFont( QFont(current[3]) ); + // - Font Size + ui->spin_session_fontsize->setValue( current[4].section("p",0,0).toInt() ); + sessionstartchanged(); //make sure to update buttons } @@ -1407,6 +1460,14 @@ void MainUI::saveSessionSettings(){ sessionsettings->setValue("EnableNumlock", ui->check_session_numlock->isChecked()); sessionsettings->setValue("PlayStartupAudio", ui->check_session_playloginaudio->isChecked()); sessionsettings->setValue("PlayLogoutAudio", ui->check_session_playlogoutaudio->isChecked()); + + //Now do the theme options + QString themefile = ui->combo_session_themefile->itemData( ui->combo_session_themefile->currentIndex() ).toString(); + QString colorfile = ui->combo_session_colorfile->itemData( ui->combo_session_colorfile->currentIndex() ).toString(); + QString iconset = ui->combo_session_icontheme->currentText(); + QString font = ui->font_session_theme->currentFont().family(); + QString fontsize = QString::number(ui->spin_session_fontsize->value())+"pt"; + LTHEME::setCurrentSettings( themefile, colorfile, iconset, font, fontsize); } void MainUI::rmsessionstartitem(){ diff --git a/lumina-config/mainUI.h b/lumina-config/mainUI.h index d40438db..038651d7 100644 --- a/lumina-config/mainUI.h +++ b/lumina-config/mainUI.h @@ -21,6 +21,7 @@ // libLumina includes #include <LuminaXDG.h> +#include <LuminaThemes.h> // local includes #include "LPlugins.h" @@ -52,7 +53,6 @@ private: int panelnumber; //General purpose functions (not connected to buttons) - void setupIcons(); //called during initialization void setupMenus(); //called during initialization void setupConnections(); //called during intialization @@ -73,6 +73,9 @@ private: QStringList readFile(QString path); bool overwriteFile(QString path, QStringList contents); +public slots: + void setupIcons(); //called during initialization + private slots: void slotSingleInstance(); diff --git a/lumina-config/mainUI.ui b/lumina-config/mainUI.ui index 7dd97862..7f8f2ae8 100644 --- a/lumina-config/mainUI.ui +++ b/lumina-config/mainUI.ui @@ -87,14 +87,11 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="styleSheet"> - <string notr="true">QWidget#page_desktop,#page_panels,#page_menu,#page_shortcuts,#page_defaults,#page_session{background-color: rgba(255,255,255,150); }</string> - </property> <property name="frameShape"> <enum>QFrame::StyledPanel</enum> </property> <property name="currentIndex"> - <number>2</number> + <number>5</number> </property> <widget class="QWidget" name="page_desktop"> <layout class="QVBoxLayout" name="verticalLayout_3"> @@ -372,8 +369,8 @@ <rect> <x>0</x> <y>0</y> - <width>166</width> - <height>92</height> + <width>157</width> + <height>90</height> </rect> </property> <attribute name="label"> @@ -454,8 +451,8 @@ <rect> <x>0</x> <y>0</y> - <width>194</width> - <height>107</height> + <width>177</width> + <height>106</height> </rect> </property> <attribute name="label"> @@ -592,8 +589,8 @@ <rect> <x>0</x> <y>0</y> - <width>166</width> - <height>92</height> + <width>157</width> + <height>90</height> </rect> </property> <attribute name="label"> @@ -674,8 +671,8 @@ <rect> <x>0</x> <y>0</y> - <width>194</width> - <height>107</height> + <width>177</width> + <height>106</height> </rect> </property> <attribute name="label"> @@ -1107,8 +1104,115 @@ <string/> </property> <property name="currentIndex"> - <number>2</number> + <number>0</number> </property> + <widget class="QWidget" name="tab_theme"> + <attribute name="title"> + <string>Theme</string> + </attribute> + <layout class="QFormLayout" name="formLayout_3"> + <item row="0" column="0"> + <widget class="QLabel" name="label_12"> + <property name="text"> + <string>Font:</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QFontComboBox" name="font_session_theme"> + <property name="editable"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_14"> + <property name="text"> + <string>Font Size:</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QSpinBox" name="spin_session_fontsize"> + <property name="suffix"> + <string> point</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_16"> + <property name="text"> + <string>Theme Template:</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_12"> + <item> + <widget class="QComboBox" name="combo_session_themefile"> + <property name="sizeAdjustPolicy"> + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="tool_session_newtheme"> + <property name="toolTip"> + <string>Create/Edit a theme template (Advanced)</string> + </property> + <property name="statusTip"> + <string/> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_17"> + <property name="text"> + <string>Color Scheme:</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_19"> + <item> + <widget class="QComboBox" name="combo_session_colorfile"> + <property name="sizeAdjustPolicy"> + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="tool_session_newcolor"> + <property name="toolTip"> + <string>Create/Edit a color scheme</string> + </property> + <property name="statusTip"> + <string/> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + <item row="4" column="1"> + <widget class="QComboBox" name="combo_session_icontheme"/> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="label_18"> + <property name="text"> + <string>Icon Pack:</string> + </property> + </widget> + </item> + </layout> + </widget> <widget class="QWidget" name="tab"> <attribute name="title"> <string>General Options</string> @@ -1279,9 +1383,6 @@ <layout class="QVBoxLayout" name="verticalLayout_12"> <item> <widget class="QScrollArea" name="scrollArea"> - <property name="styleSheet"> - <string notr="true">background: grey;</string> - </property> <property name="widgetResizable"> <bool>true</bool> </property> @@ -1290,8 +1391,8 @@ <rect> <x>0</x> <y>0</y> - <width>491</width> - <height>59</height> + <width>515</width> + <height>78</height> </rect> </property> <property name="sizePolicy"> @@ -1398,7 +1499,7 @@ <x>0</x> <y>0</y> <width>579</width> - <height>19</height> + <height>20</height> </rect> </property> </widget> |