mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 23:29:07 +08:00
CURA-4400 improved enabled / disabled extruder visually, improved colors of dark theme
This commit is contained in:
parent
8af82cc3f4
commit
f8709b6d1a
@ -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;
|
||||
|
@ -84,16 +84,16 @@
|
||||
"tab_background": [39, 44, 48, 255],
|
||||
|
||||
"action_button": [39, 44, 48, 255],
|
||||
"action_button_text": [255, 255, 255, 101],
|
||||
"action_button_text": [255, 255, 255, 200],
|
||||
"action_button_border": [255, 255, 255, 30],
|
||||
"action_button_hovered": [39, 44, 48, 255],
|
||||
"action_button_hovered_text": [255, 255, 255, 255],
|
||||
"action_button_hovered_border": [255, 255, 255, 30],
|
||||
"action_button_active": [39, 44, 48, 30],
|
||||
"action_button_active_text": [255, 255, 255, 255],
|
||||
"action_button_active_border": [255, 255, 255, 30],
|
||||
"action_button_active_border": [255, 255, 255, 100],
|
||||
"action_button_disabled": [39, 44, 48, 255],
|
||||
"action_button_disabled_text": [255, 255, 255, 101],
|
||||
"action_button_disabled_text": [255, 255, 255, 80],
|
||||
"action_button_disabled_border": [255, 255, 255, 30],
|
||||
|
||||
"scrollbar_background": [39, 44, 48, 0],
|
||||
|
Loading…
x
Reference in New Issue
Block a user