Browse Source

Change top bar text colour depending on hover and active state

Too bad we have to introduce additional theme entries for this sort of thing. Makes it harder to modify the theme!

Contributes to issue CURA-4148.
Ghostkeeper 7 years ago
parent
commit
d73bbabda9
2 changed files with 17 additions and 3 deletions
  1. 2 2
      resources/qml/Topbar.qml
  2. 15 1
      resources/themes/cura/styles.qml

+ 2 - 2
resources/qml/Topbar.qml

@@ -44,7 +44,7 @@ Rectangle
             iconSource: UM.Theme.getIcon("tab_settings");
             property color overlayColor: "transparent"
             property string overlayIconSource: ""
-            text: catalog.i18nc("@title:tab","Prepare")
+            text: catalog.i18nc("@title:tab", "Prepare")
             checkable: true
             checked: !base.monitoringPrint
             exclusiveGroup: sidebarHeaderBarGroup
@@ -197,7 +197,7 @@ Rectangle
                 Label
                 {
                     id: sidebarComboBoxLabel
-                    color: UM.Theme.getColor("text_reversed")
+                    color: UM.Theme.getColor("sidebar_header_text_active")
                     text: control.text;
                     elide: Text.ElideRight;
                     anchors.left: parent.left;

+ 15 - 1
resources/themes/cura/styles.qml

@@ -210,7 +210,21 @@ QtObject {
                         anchors.leftMargin: Theme.getSize("default_margin").width
                         anchors.verticalCenter: parent.verticalCenter;
                         font: UM.Theme.getFont("large");
-                        color: UM.Theme.getColor("text_reversed")
+                        color:
+                        {
+                            if(control.hovered)
+                            {
+                                return UM.Theme.getColor("sidebar_header_text_hover");
+                            }
+                            if(control.checked)
+                            {
+                                return UM.Theme.getColor("sidebar_header_text_active");
+                            }
+                            else
+                            {
+                                return UM.Theme.getColor("sidebar_header_text_inactive");
+                            }
+                        }
                     }
                 }
             }