From 226bb7b0702fca374be39e87b8865efba25cf8c3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 21 Aug 2017 11:55:47 +0200 Subject: [PATCH] Write out border colour as full-fledged function This makes it easier to read and to modify this functionality rather than a string of ternary operators. It's about to become more complicated too. Contributes to issue CURA-4148. --- resources/themes/cura/styles.qml | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index 30e3ce9ab8..c8d5b07e03 100755 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -66,18 +66,37 @@ QtObject { else if(control.valueWarning) { return Theme.getColor("setting_validation_warning"); - } else + } + else { return Theme.getColor("setting_control"); } - } else { + } + else + { return Theme.getColor("setting_control_disabled"); } } border.width: Theme.getSize("default_lining").width - border.color: !control.enabled ? Theme.getColor("setting_control_disabled_border") : - control.hovered ? Theme.getColor("setting_control_border_highlight") : Theme.getColor("setting_control_border") + border.color: + { + if (control_enabled) + { + if (control.hovered) + { + return Theme.getColor("setting_control_border_highlight"); + } + else + { + return Theme.getColor("setting_control_border"); + } + } + else + { + return Theme.getColor("setting_control_disabled_border"); + } + } UM.RecolorImage { id: downArrow anchors.verticalCenter: parent.verticalCenter