diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-09-08 10:29:57 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-09-12 08:27:37 +0000 |
commit | 2bdf059e6e62fda8e1df108f0a68651e546b0f67 (patch) | |
tree | f7b3bdf8a5b61814b827217bf3ad66e8879cd670 /src/imports/controls/RangeSlider.qml | |
parent | 86180aed5008779b1b94731d9b4c6b1fdac8f3d3 (diff) |
Default: consolidate style colors into a singleton
This reduces all of the duplicate literals that we currently have.
Task-number: QTBUG-55867
Change-Id: I28f1f646d25f2f6578d52b4ba96f8f0f3ad6706b
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/imports/controls/RangeSlider.qml')
-rw-r--r-- | src/imports/controls/RangeSlider.qml | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/imports/controls/RangeSlider.qml b/src/imports/controls/RangeSlider.qml index a201d446..14d7e271 100644 --- a/src/imports/controls/RangeSlider.qml +++ b/src/imports/controls/RangeSlider.qml @@ -35,6 +35,8 @@ ****************************************************************************/ import QtQuick 2.6 +import QtQuick.Controls 2.1 +import QtQuick.Controls.impl 2.1 import QtQuick.Templates 2.1 as T T.RangeSlider { @@ -57,8 +59,12 @@ T.RangeSlider { implicitHeight: 28 radius: width / 2 border.width: activeFocus ? 2 : 1 - border.color: control.enabled ? (activeFocus ? "#0066ff" : (control.first.pressed ? "#808080" : "#909090")) : "#d6d6d6" - color: control.enabled ? (first.pressed ? (activeFocus ? "#cce0ff" : "#f6f6f6") : (activeFocus ? "#f0f6ff" : "#ffffff")) : "#fdfdfd" + border.color: control.enabled ? (activeFocus + ? Default.focusColor + : (control.first.pressed ? Default.indicatorFramePressedColor : Default.indicatorFrameColor)) : Default.indicatorFrameDisabledColor + color: control.enabled ? (first.pressed + ? (activeFocus ? Default.focusPressedColor : Default.indicatorPressedColor) + : (activeFocus ? Default.focusLightColor : Default.backgroundColor)) : Default.indicatorDisabledColor readonly property bool horizontal: control.orientation === Qt.Horizontal } @@ -72,8 +78,12 @@ T.RangeSlider { implicitHeight: 28 radius: width / 2 border.width: activeFocus ? 2 : 1 - border.color: control.enabled ? (activeFocus ? "#0066ff" : (control.first.pressed ? "#808080" : "#909090")) : "#d6d6d6" - color: control.enabled ? (second.pressed ? (activeFocus ? "#cce0ff" : "#f6f6f6") : (activeFocus ? "#f0f6ff" : "#ffffff")) : "#fdfdfd" + border.color: control.enabled ? (activeFocus + ? Default.focusColor + : (control.first.pressed ? Default.indicatorFramePressedColor : Default.indicatorFrameColor)) : Default.indicatorFrameDisabledColor + color: control.enabled ? (second.pressed + ? (activeFocus ? Default.focusPressedColor : Default.indicatorPressedColor) + : (activeFocus ? Default.focusLightColor : Default.backgroundColor)) : Default.indicatorDisabledColor readonly property bool horizontal: control.orientation === Qt.Horizontal } @@ -89,7 +99,7 @@ T.RangeSlider { height: horizontal ? implicitHeight : control.availableHeight radius: 3 opacity: control.enabled ? 1 : 0.3 - color: "#e0e0e0" + color: Default.buttonColor scale: horizontal && control.mirrored ? -1 : 1 readonly property bool horizontal: control.orientation === Qt.Horizontal |