From d73bbabda9dea2cdb3536b59b219f0080fa60e77 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 21 Aug 2017 14:11:16 +0200 Subject: [PATCH] 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. --- resources/qml/Topbar.qml | 4 ++-- resources/themes/cura/styles.qml | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/resources/qml/Topbar.qml b/resources/qml/Topbar.qml index 1b5792124e..cae7fec108 100644 --- a/resources/qml/Topbar.qml +++ b/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; diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index b0013ca894..d3069287da 100755 --- a/resources/themes/cura/styles.qml +++ b/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"); + } + } } } }