mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 06:45:09 -06:00
CURA-4400 improved enabled / disabled extruder visually, improved colors of dark theme
This commit is contained in:
parent
8af82cc3f4
commit
f8709b6d1a
2 changed files with 36 additions and 14 deletions
|
@ -186,22 +186,34 @@ Column
|
|||
{
|
||||
background: Item
|
||||
{
|
||||
Rectangle
|
||||
function buttonBackgroundColor(index)
|
||||
{
|
||||
anchors.fill: parent
|
||||
border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width
|
||||
border.color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_border") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_border") :
|
||||
UM.Theme.getColor("action_button_border")
|
||||
color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered") :
|
||||
UM.Theme.getColor("action_button")
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
var extruder = Cura.MachineManager.getExtruder(index)
|
||||
if (extruder.isEnabled) {
|
||||
return (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered") :
|
||||
UM.Theme.getColor("action_button")
|
||||
} else {
|
||||
return UM.Theme.getColor("action_button_disabled")
|
||||
}
|
||||
}
|
||||
|
||||
function buttonBorderColor(index)
|
||||
{
|
||||
var extruder = Cura.MachineManager.getExtruder(index)
|
||||
if (extruder.isEnabled) {
|
||||
return (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_border") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_border") :
|
||||
UM.Theme.getColor("action_button_border")
|
||||
} else {
|
||||
return UM.Theme.getColor("action_button_disabled_border")
|
||||
}
|
||||
}
|
||||
|
||||
function buttonColor(index) {
|
||||
var extruder = Cura.MachineManager.getExtruder(index);
|
||||
if (extruder.isEnabled) {
|
||||
if (extruder.isEnabled)
|
||||
{
|
||||
return (
|
||||
control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_text") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_text") :
|
||||
|
@ -211,10 +223,20 @@ Column
|
|||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
anchors.fill: parent
|
||||
border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width
|
||||
border.color: buttonBorderColor(index)
|
||||
color: buttonBackgroundColor(index)
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
id: extruderButtonFace
|
||||
anchors.centerIn: parent
|
||||
|
||||
width: {
|
||||
var extruderTextWidth = extruderStaticText.visible ? extruderStaticText.width : 0;
|
||||
var iconWidth = extruderIconItem.width;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue