mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 16:28:59 +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
|
background: Item
|
||||||
{
|
{
|
||||||
Rectangle
|
function buttonBackgroundColor(index)
|
||||||
{
|
{
|
||||||
anchors.fill: parent
|
var extruder = Cura.MachineManager.getExtruder(index)
|
||||||
border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width
|
if (extruder.isEnabled) {
|
||||||
border.color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_border") :
|
return (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") :
|
||||||
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") :
|
control.hovered ? UM.Theme.getColor("action_button_hovered") :
|
||||||
UM.Theme.getColor("action_button")
|
UM.Theme.getColor("action_button")
|
||||||
Behavior on color { ColorAnimation { duration: 50; } }
|
} 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) {
|
function buttonColor(index) {
|
||||||
var extruder = Cura.MachineManager.getExtruder(index);
|
var extruder = Cura.MachineManager.getExtruder(index);
|
||||||
if (extruder.isEnabled) {
|
if (extruder.isEnabled)
|
||||||
|
{
|
||||||
return (
|
return (
|
||||||
control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_text") :
|
control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_text") :
|
||||||
control.hovered ? UM.Theme.getColor("action_button_hovered_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
|
Item
|
||||||
{
|
{
|
||||||
id: extruderButtonFace
|
id: extruderButtonFace
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
width: {
|
width: {
|
||||||
var extruderTextWidth = extruderStaticText.visible ? extruderStaticText.width : 0;
|
var extruderTextWidth = extruderStaticText.visible ? extruderStaticText.width : 0;
|
||||||
var iconWidth = extruderIconItem.width;
|
var iconWidth = extruderIconItem.width;
|
||||||
|
@ -84,16 +84,16 @@
|
|||||||
"tab_background": [39, 44, 48, 255],
|
"tab_background": [39, 44, 48, 255],
|
||||||
|
|
||||||
"action_button": [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_border": [255, 255, 255, 30],
|
||||||
"action_button_hovered": [39, 44, 48, 255],
|
"action_button_hovered": [39, 44, 48, 255],
|
||||||
"action_button_hovered_text": [255, 255, 255, 255],
|
"action_button_hovered_text": [255, 255, 255, 255],
|
||||||
"action_button_hovered_border": [255, 255, 255, 30],
|
"action_button_hovered_border": [255, 255, 255, 30],
|
||||||
"action_button_active": [39, 44, 48, 30],
|
"action_button_active": [39, 44, 48, 30],
|
||||||
"action_button_active_text": [255, 255, 255, 255],
|
"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": [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],
|
"action_button_disabled_border": [255, 255, 255, 30],
|
||||||
|
|
||||||
"scrollbar_background": [39, 44, 48, 0],
|
"scrollbar_background": [39, 44, 48, 0],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user