diff options
author | Jack Ha <jackha@gmail.com> | 2018-02-28 13:01:32 +0300 |
---|---|---|
committer | Jack Ha <jackha@gmail.com> | 2018-02-28 14:56:00 +0300 |
commit | 86c13e86c742610e225724a94251dd142421f8c2 (patch) | |
tree | bf632a76ecf9d688f08db126a448eb4d09d398d7 /resources/qml/SidebarHeader.qml | |
parent | 7507ba10a93d0fe755b4576f9237c798249e745b (diff) |
CURA-4400 first version that disables extruder and updates available quality profiles
Diffstat (limited to 'resources/qml/SidebarHeader.qml')
-rw-r--r-- | resources/qml/SidebarHeader.qml | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 5d9cbe2ad1..a9aefe4848 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -114,6 +114,18 @@ Column Behavior on color { ColorAnimation { duration: 50; } } } + function buttonColor(index) { + var extruder = Cura.MachineManager.getExtruder(index); + if (extruder.isEnabled) { + return ( + control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_text") : + control.hovered ? UM.Theme.getColor("action_button_hovered_text") : + UM.Theme.getColor("action_button_text"); + } else { + return UM.Theme.getColor("action_button_disabled"); + } + } + Item { id: extruderButtonFace @@ -131,9 +143,7 @@ Column anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left - color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_text") : - control.hovered ? UM.Theme.getColor("action_button_hovered_text") : - UM.Theme.getColor("action_button_text") + color: buttonColor(index) font: UM.Theme.getFont("large_nonbold") text: catalog.i18nc("@label", "Extruder") @@ -176,9 +186,7 @@ Column id: extruderNumberText anchors.centerIn: parent text: index + 1; - color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_text") : - control.hovered ? UM.Theme.getColor("action_button_hovered_text") : - UM.Theme.getColor("action_button_text") + color: buttonColor(index) font: UM.Theme.getFont("default_bold") } |