From 00d75cd4d600866933147e9a0ae75e790ebf95e6 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 30 Oct 2018 12:28:51 +0100 Subject: [PATCH] Tweak the colors of the disabled state. Contributes to CURA-5786. --- resources/qml/SliceProcessWidget.qml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/resources/qml/SliceProcessWidget.qml b/resources/qml/SliceProcessWidget.qml index c9ff7178fd..98f708a9b0 100644 --- a/resources/qml/SliceProcessWidget.qml +++ b/resources/qml/SliceProcessWidget.qml @@ -108,27 +108,24 @@ Column height: UM.Theme.getSize("action_panel_button").height text: { + if ([1, 4, 5].indexOf(widget.backendState) != -1) // == BackendState.NotStarted or BackendState.Error or BackendState.Disabled + { + return catalog.i18nc("@button", "Slice") + } if (autoSlice) { return catalog.i18nc("@button", "Auto slicing...") } - else if ([1, 5].indexOf(widget.backendState) != -1) // == BackendState.NotStarted or BackendState.Disabled - { - return catalog.i18nc("@button", "Slice") - } - else - { - return catalog.i18nc("@button", "Cancel") - } + return catalog.i18nc("@button", "Cancel") } - enabled: !autoSlice + enabled: !autoSlice && ([1, 2].indexOf(widget.backendState) != -1) // Get the current value from the preferences property bool autoSlice: UM.Preferences.getValue("general/auto_slice") - disabledColor: "transparent" - textDisabledColor: UM.Theme.getColor("primary") - outlineDisabledColor: "transparent" + disabledColor: ([1, 2].indexOf(widget.backendState) == -1) ? UM.Theme.getColor("action_button_disabled") : "transparent" + textDisabledColor: ([1, 2].indexOf(widget.backendState) == -1) ? UM.Theme.getColor("action_button_disabled_text") : UM.Theme.getColor("primary") + outlineDisabledColor: ([1, 2].indexOf(widget.backendState) == -1) ? UM.Theme.getColor("action_button_disabled_border") : "transparent" onClicked: sliceOrStopSlicing() }