aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-02-05 07:49:20 -0500
committerKen Moore <ken@pcbsd.org>2015-02-05 07:49:20 -0500
commit74aae81aa755246d5de1a83e9d7b46fdd59934b1 (patch)
tree1dcff81c83f5533afcef81a76262adb55d9db2ce
parentClean up the default theme template a bit more, and remove some leftover styl... (diff)
downloadlumina-74aae81aa755246d5de1a83e9d7b46fdd59934b1.tar.gz
lumina-74aae81aa755246d5de1a83e9d7b46fdd59934b1.tar.bz2
lumina-74aae81aa755246d5de1a83e9d7b46fdd59934b1.zip
Finish cleaning up that last bits of hard-coded stylesheets, and tie them in to the lumina theme system.
-rw-r--r--libLumina/themes/Lumina-default.qss.template29
-rw-r--r--lumina-desktop/panel-plugins/LTBWidget.h24
-rw-r--r--lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp4
3 files changed, 44 insertions, 13 deletions
diff --git a/libLumina/themes/Lumina-default.qss.template b/libLumina/themes/Lumina-default.qss.template
index edd7b73b..d01608db 100644
--- a/libLumina/themes/Lumina-default.qss.template
+++ b/libLumina/themes/Lumina-default.qss.template
@@ -23,7 +23,34 @@ LDPlugin#LuminaDesktopPluginVisible{
border: 1px solid transparent;
border-radius: 5px;
}
-
+/*For the special widgets on the user button*/
+UserItemWidget{
+ background: transparent;
+ border-radius: 3px;
+}
+UserItemWidget:hover{
+ background: %%HIGHLIGHTCOLOR%%;
+ color: %%TEXTHIGHLIGHTCOLOR%%;
+}
+/*Special taskmanager window buttons: based on window state*/
+LTBWidget{
+ border: 1px solid transparent;
+ border-radius: 3px;
+}
+LTBWidget::menu-indicator{ image: none; } /*disable the menu arrow*/
+LTBWidget#WindowVisible{
+ background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 %%SECONDARYDISABLECOLOR%%, stop: 1 transparent);
+}
+LTBWidget#WindowInvisible{
+ /* Primary color is used for the panel appearance, so use that to make it disappear*/
+ background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 %%PRIMARYCOLOR%%, stop: 1 transparent);
+}
+LTBWidget#WindowActive{
+ background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 %%ACCENTCOLOR%%, stop: 1 transparent);
+}
+LTBWidget#WindowAttention{
+ background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 %%HIGHLIGHTDISABLECOLOR%%, stop: 1 transparent);
+}
/* ALL THE WIDGETS WITH THE BASE COLOR */
QMainWindow, QMenu, QDialog, QMessageBox{
background: %%BASECOLOR%%;
diff --git a/lumina-desktop/panel-plugins/LTBWidget.h b/lumina-desktop/panel-plugins/LTBWidget.h
index d1e69b6e..53ea1be0 100644
--- a/lumina-desktop/panel-plugins/LTBWidget.h
+++ b/lumina-desktop/panel-plugins/LTBWidget.h
@@ -19,17 +19,18 @@ class LTBWidget : public QToolButton{
private:
LXCB::WINDOWSTATE cstate;
- QString rawstyle;
+ //QString rawstyle;
void updateBackground(){
- QString background = "background: transparent; "; //default value
- QString border = "border: 1px solid transparent;";
- if(cstate == LXCB::IGNORE){ } //just use the defaults
- else if(cstate == LXCB::VISIBLE){ background = "background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(255, 255, 255, 240), stop:0.505682 rgba(240, 240, 240, 150), stop:1 rgba(210, 210, 210, 55));"; border="border: 1px solid transparent;"; }
- else if(cstate == LXCB::INVISIBLE){background = "background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(215, 215, 215, 240), stop:0.505682 rgba(184, 185, 186, 150), stop:1 rgba(221, 246, 255, 55));"; border="border: 1px solid transparent;"; }
- else if(cstate == LXCB::ACTIVE){ background= "background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(241, 233, 156, 240), stop:0.355682 rgba(255, 243, 127, 150), stop:1 rgba(221, 246, 255, 55));"; border ="border: 1px solid transparent;"; }
- else if(cstate == LXCB::ATTENTION){ background= "background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(252, 187, 127, 240), stop:0.505682 rgba(255, 222, 197, 150), stop:1 rgba(221, 246, 255, 55));"; border="border: 1px solid transparent;"; }
- QString raw = rawstyle;
- this->setStyleSheet( raw.replace("%1",background).replace("%2", border) );
+ //QString background = "background: transparent; "; //default value
+ //QString border = "border: 1px solid transparent;";
+ if(cstate == LXCB::IGNORE){ this->setObjectName(""); } //just use the defaults
+ else if(cstate == LXCB::VISIBLE){ this->setObjectName("WindowVisible"); }//background = "background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(255, 255, 255, 240), stop:0.505682 rgba(240, 240, 240, 150), stop:1 rgba(210, 210, 210, 55));"; border="border: 1px solid transparent;"; }
+ else if(cstate == LXCB::INVISIBLE){this->setObjectName("WindowInvisible"); } //background = "background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(215, 215, 215, 240), stop:0.505682 rgba(184, 185, 186, 150), stop:1 rgba(221, 246, 255, 55));"; border="border: 1px solid transparent;"; }
+ else if(cstate == LXCB::ACTIVE){ this->setObjectName("WindowActive"); }//background= "background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(241, 233, 156, 240), stop:0.355682 rgba(255, 243, 127, 150), stop:1 rgba(221, 246, 255, 55));"; border ="border: 1px solid transparent;"; }
+ else if(cstate == LXCB::ATTENTION){ this->setObjectName("WindowAttention"); }//background= "background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(252, 187, 127, 240), stop:0.505682 rgba(255, 222, 197, 150), stop:1 rgba(221, 246, 255, 55));"; border="border: 1px solid transparent;"; }
+ this->setStyleSheet(""); //force the object to re-evaluate the current theme stylesheet and update visuals
+ //QString raw = rawstyle;
+ //this->setStyleSheet( raw.replace("%1",background).replace("%2", border) );
}
signals:
@@ -43,7 +44,8 @@ public:
this->setPopupMode(QToolButton::InstantPopup);
this->setAutoRaise(true);
- rawstyle = "LTBWidget{ %1 %2 border-radius: 5px;} LTBWidget::menu-indicator{image: none;} LTBWidget::hover{ %1 border: 1px solid black; border-radius: 5px; } LTBWidget::menu-button{ background: transparent; width: 15px; } LTBWidget[popupMode=\"1\"]{%1 %2 border-radius: 5px; padding-right: 15px;} LTBWidget[popupMode=\"1\"]::hover{%1 border: 1px solid black; border-radius: 5px; padding-right: 15px}";
+
+ //rawstyle = "LTBWidget{ %1 %2 border-radius: 5px;} LTBWidget::menu-indicator{image: none;} LTBWidget::hover{ %1 border: 1px solid black; border-radius: 5px; } LTBWidget::menu-button{ background: transparent; width: 15px; } LTBWidget[popupMode=\"1\"]{%1 %2 border-radius: 5px; padding-right: 15px;} LTBWidget[popupMode=\"1\"]::hover{%1 border: 1px solid black; border-radius: 5px; padding-right: 15px}";
updateBackground();
}
diff --git a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
index 9bfbbb8d..3b8be74f 100644
--- a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
+++ b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
@@ -78,8 +78,10 @@ void UserItemWidget::createWidget(){
this->layout()->addWidget(icon);
this->layout()->addWidget(name);
this->layout()->addWidget(button);
+ //Set a custom object name so this can be tied into the Lumina Theme stylesheets
+ this->setObjectName("LuminaUserItemWidget");
//Install the stylesheet
- this->setStyleSheet("UserItemWidget{ background: transparent; border-radius: 5px;} UserItemWidget::hover{ background: rgba(255,255,255,200); border-radius: 5px; }");
+ //this->setStyleSheet("UserItemWidget{ background: transparent; border-radius: 5px;} UserItemWidget::hover{ background: rgba(255,255,255,200); border-radius: 5px; }");
}
void UserItemWidget::setupButton(bool disable){
bgstack15