diff options
author | Paweł Gronowski <a4b8231fbf6d87ff4c04@woland.xyz> | 2020-03-10 21:32:46 +0100 |
---|---|---|
committer | Paweł Gronowski <a4b8231fbf6d87ff4c04@woland.xyz> | 2020-03-17 12:09:46 +0100 |
commit | a73b19daa8ef0e3feb2ee21f9d1e7bc77801636c (patch) | |
tree | b290fcc0651bdd878e4263e96c14b2e35ff296cc /src/imports/controls | |
parent | 0da47cd293db56563177b089a22c9c599ee41226 (diff) |
Material: Make RangeSlider's track accent colored and semi-transparent
To match the Slider's appearance.
Change-Id: Ida7a03877c7b8a23508c532dbb275f96bc137742
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls')
-rw-r--r-- | src/imports/controls/material/RangeSlider.qml | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/imports/controls/material/RangeSlider.qml b/src/imports/controls/material/RangeSlider.qml index 16a6c82d..f05601a7 100644 --- a/src/imports/controls/material/RangeSlider.qml +++ b/src/imports/controls/material/RangeSlider.qml @@ -36,6 +36,7 @@ import QtQuick 2.12 import QtQuick.Templates 2.12 as T +import QtQuick.Controls.impl 2.12 import QtQuick.Controls.Material 2.12 import QtQuick.Controls.Material.impl 2.12 @@ -74,16 +75,16 @@ T.RangeSlider { y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) implicitWidth: control.horizontal ? 200 : 48 implicitHeight: control.horizontal ? 48 : 200 - width: control.horizontal ? control.availableWidth : 1 - height: control.horizontal ? 1 : control.availableHeight - color: control.Material.foreground - scale:control.horizontal && control.mirrored ? -1 : 1 + width: control.horizontal ? control.availableWidth : 4 + height: control.horizontal ? 4 : control.availableHeight + scale: control.horizontal && control.mirrored ? -1 : 1 + color: control.enabled ? Color.transparent(control.Material.accentColor, 0.33) : control.Material.sliderDisabledColor Rectangle { - x: control.horizontal ? control.first.position * parent.width : -1 - y: control.horizontal ? -1 : control.second.visualPosition * parent.height + 3 - width: control.horizontal ? control.second.position * parent.width - control.first.position * parent.width - 3 : 3 - height: control.horizontal ? 3 : control.second.position * parent.height - control.first.position * parent.height - 3 + x: control.horizontal ? control.first.position * parent.width : 0 + y: control.horizontal ? 0 : control.second.visualPosition * parent.height + width: control.horizontal ? control.second.position * parent.width - control.first.position * parent.width : 4 + height: control.horizontal ? 4 : control.second.position * parent.height - control.first.position * parent.height color: control.enabled ? control.Material.accentColor : control.Material.sliderDisabledColor } |