mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Make button text and icons change colour on active and hover
Just like the background colour, the foreground colour may now also change. Contributes to issue CURA-4148.
This commit is contained in:
parent
d73bbabda9
commit
f88ffee638
1 changed files with 38 additions and 2 deletions
|
@ -301,7 +301,25 @@ QtObject {
|
||||||
sourceSize.width: width
|
sourceSize.width: width
|
||||||
sourceSize.height: width
|
sourceSize.height: width
|
||||||
visible: control.menu != null;
|
visible: control.menu != null;
|
||||||
color: Theme.getColor("button_text")
|
color:
|
||||||
|
{
|
||||||
|
if(control.checkable && control.checked && control.hovered)
|
||||||
|
{
|
||||||
|
return Theme.getColor("button_text_active_hover");
|
||||||
|
}
|
||||||
|
else if(control.pressed || (control.checkable && control.checked))
|
||||||
|
{
|
||||||
|
return Theme.getColor("button_text_active");
|
||||||
|
}
|
||||||
|
else if(control.hovered)
|
||||||
|
{
|
||||||
|
return Theme.getColor("button_text_hover");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Theme.getColor("button_text");
|
||||||
|
}
|
||||||
|
}
|
||||||
source: Theme.getIcon("arrow_bottom")
|
source: Theme.getIcon("arrow_bottom")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -314,7 +332,25 @@ QtObject {
|
||||||
source: control.iconSource;
|
source: control.iconSource;
|
||||||
width: Theme.getSize("button_icon").width;
|
width: Theme.getSize("button_icon").width;
|
||||||
height: Theme.getSize("button_icon").height;
|
height: Theme.getSize("button_icon").height;
|
||||||
color: Theme.getColor("button_text")
|
color:
|
||||||
|
{
|
||||||
|
if(control.checkable && control.checked && control.hovered)
|
||||||
|
{
|
||||||
|
return Theme.getColor("button_text_active_hover");
|
||||||
|
}
|
||||||
|
else if(control.pressed || (control.checkable && control.checked))
|
||||||
|
{
|
||||||
|
return Theme.getColor("button_text_active");
|
||||||
|
}
|
||||||
|
else if(control.hovered)
|
||||||
|
{
|
||||||
|
return Theme.getColor("button_text_hover");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Theme.getColor("button_text");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sourceSize: Theme.getSize("button_icon")
|
sourceSize: Theme.getSize("button_icon")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue