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

@ -197,7 +197,7 @@ Rectangle
Label Label
{ {
id: sidebarComboBoxLabel id: sidebarComboBoxLabel
color: UM.Theme.getColor("text_reversed") color: UM.Theme.getColor("sidebar_header_text_active")
text: control.text; text: control.text;
elide: Text.ElideRight; elide: Text.ElideRight;
anchors.left: parent.left; anchors.left: parent.left;

View file

@ -210,7 +210,21 @@ QtObject {
anchors.leftMargin: Theme.getSize("default_margin").width anchors.leftMargin: Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter; anchors.verticalCenter: parent.verticalCenter;
font: UM.Theme.getFont("large"); 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");
}
}
} }
} }
} }