mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 05:45:55 +08: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
@ -301,7 +301,25 @@ QtObject {
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
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")
|
||||
}
|
||||
}
|
||||
@ -314,7 +332,25 @@ QtObject {
|
||||
source: control.iconSource;
|
||||
width: Theme.getSize("button_icon").width;
|
||||
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")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user