mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-12 19:38:03 +08:00
Add hover and active colours for setting category text
They need to be able to have a different text colour depending on whether you're hovering, the category is expanded or not, etc. Contributes to issue CURA-4148.
This commit is contained in:
parent
b2338d9c2e
commit
02e96f510a
@ -114,7 +114,7 @@ QtObject {
|
|||||||
height: Theme.getSize("standard_arrow").height
|
height: Theme.getSize("standard_arrow").height
|
||||||
sourceSize.width: width
|
sourceSize.width: width
|
||||||
sourceSize.height: width
|
sourceSize.height: width
|
||||||
color: control.enabled ? Theme.getColor("setting_category_text") : Theme.getColor("setting_control_disabled_text")
|
color: control.enabled ? Theme.getColor("setting_category_text") : Theme.getColor("setting_category_disabled_text")
|
||||||
source: Theme.getIcon("arrow_bottom")
|
source: Theme.getIcon("arrow_bottom")
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
@ -458,7 +458,29 @@ QtObject {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: Theme.getSize("default_margin").width
|
anchors.leftMargin: Theme.getSize("default_margin").width
|
||||||
color: Theme.getColor("setting_category_text")
|
color:
|
||||||
|
{
|
||||||
|
if(!control.enabled)
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_category_disabled_text");
|
||||||
|
}
|
||||||
|
else if((control.hovered || control.activeFocus) && control.checkable && control.checked)
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_category_active_hover_text");
|
||||||
|
}
|
||||||
|
else if(control.pressed || (control.checkable && control.checked))
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_category_active_text");
|
||||||
|
}
|
||||||
|
else if(control.hovered || control.activeFocus)
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_category_hover_text");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_category_text");
|
||||||
|
}
|
||||||
|
}
|
||||||
source: control.iconSource;
|
source: control.iconSource;
|
||||||
width: Theme.getSize("section_icon").width;
|
width: Theme.getSize("section_icon").width;
|
||||||
height: Theme.getSize("section_icon").height;
|
height: Theme.getSize("section_icon").height;
|
||||||
@ -476,7 +498,29 @@ QtObject {
|
|||||||
}
|
}
|
||||||
text: control.text;
|
text: control.text;
|
||||||
font: Theme.getFont("setting_category");
|
font: Theme.getFont("setting_category");
|
||||||
color: Theme.getColor("setting_category_text");
|
color:
|
||||||
|
{
|
||||||
|
if(!control.enabled)
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_category_disabled_text");
|
||||||
|
}
|
||||||
|
else if((control.hovered || control.activeFocus) && control.checkable && control.checked)
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_category_active_hover_text");
|
||||||
|
}
|
||||||
|
else if(control.pressed || (control.checkable && control.checked))
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_category_active_text");
|
||||||
|
}
|
||||||
|
else if(control.hovered || control.activeFocus)
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_category_hover_text");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_category_text");
|
||||||
|
}
|
||||||
|
}
|
||||||
fontSizeMode: Text.HorizontalFit;
|
fontSizeMode: Text.HorizontalFit;
|
||||||
minimumPointSize: 8
|
minimumPointSize: 8
|
||||||
}
|
}
|
||||||
@ -489,7 +533,29 @@ QtObject {
|
|||||||
height: Theme.getSize("standard_arrow").height
|
height: Theme.getSize("standard_arrow").height
|
||||||
sourceSize.width: width
|
sourceSize.width: width
|
||||||
sourceSize.height: width
|
sourceSize.height: width
|
||||||
color: Theme.getColor("setting_category_text")
|
color:
|
||||||
|
{
|
||||||
|
if(!control.enabled)
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_category_disabled_text");
|
||||||
|
}
|
||||||
|
else if((control.hovered || control.activeFocus) && control.checkable && control.checked)
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_category_active_hover_text");
|
||||||
|
}
|
||||||
|
else if(control.pressed || (control.checkable && control.checked))
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_category_active_text");
|
||||||
|
}
|
||||||
|
else if(control.hovered || control.activeFocus)
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_category_hover_text");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_category_text");
|
||||||
|
}
|
||||||
|
}
|
||||||
source: control.checked ? Theme.getIcon("arrow_bottom") : Theme.getIcon("arrow_left")
|
source: control.checked ? Theme.getIcon("arrow_bottom") : Theme.getIcon("arrow_left")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user