aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/material/impl/SliderHandle.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols/material/impl/SliderHandle.qml')
-rw-r--r--src/quickcontrols/material/impl/SliderHandle.qml38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/quickcontrols/material/impl/SliderHandle.qml b/src/quickcontrols/material/impl/SliderHandle.qml
new file mode 100644
index 0000000000..4681992ab0
--- /dev/null
+++ b/src/quickcontrols/material/impl/SliderHandle.qml
@@ -0,0 +1,38 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Controls.Material
+import QtQuick.Controls.Material.impl
+
+Item {
+ id: root
+ implicitWidth: initialSize
+ implicitHeight: initialSize
+
+ property real value: 0
+ property bool handleHasFocus: false
+ property bool handlePressed: false
+ property bool handleHovered: false
+ readonly property int initialSize: 13
+ readonly property var control: parent
+
+ Rectangle {
+ id: handleRect
+ width: parent.width
+ height: parent.height
+ radius: width / 2
+ color: root.control
+ ? root.control.enabled ? root.control.Material.accentColor : root.control.Material.sliderDisabledColor
+ : "transparent"
+ }
+
+ Ripple {
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
+ width: 22; height: 22
+ pressed: root.handlePressed
+ active: root.handlePressed || root.handleHasFocus || (enabled && root.handleHovered)
+ color: root.control ? root.control.Material.highlightedRippleColor : "transparent"
+ }
+}