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.
This commit is contained in:
Ghostkeeper 2017-08-21 14:11:16 +02:00
parent 5652bccc58
commit d73bbabda9
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
2 changed files with 17 additions and 3 deletions

View file

@ -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;

View file

@ -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");
}
}
}
}
}