quickshell-toki-night/custom/CustomSlider.qml

59 lines
1.6 KiB
QML

import qs.config
import qs.custom
import qs.services
import QtQuick
import QtQuick.Controls
Slider {
id: root
property color progressColor: Config.colors.primary
background: Item {
CustomRect {
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.topMargin: root.implicitHeight / 4
anchors.bottomMargin: root.implicitHeight / 4
implicitWidth: root.handle.x - root.implicitHeight / 6
color: root.progressColor
radius: 1000
topRightRadius: root.implicitHeight / 15
bottomRightRadius: root.implicitHeight / 15
}
CustomRect {
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.topMargin: root.implicitHeight / 4
anchors.bottomMargin: root.implicitHeight / 4
implicitWidth: parent.width - root.handle.x - root.handle.implicitWidth - root.implicitHeight / 6
color: Config.colors.container
radius: 1000
topLeftRadius: root.implicitHeight / 15
bottomLeftRadius: root.implicitHeight / 15
}
}
handle: CustomRect {
x: root.visualPosition * root.availableWidth - implicitWidth / 2
implicitWidth: root.implicitHeight / 3
implicitHeight: root.implicitHeight
color: Config.colors.secondary
radius: 1000
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: Qt.PointingHandCursor
}
}
}