2020-06-04 22:44:02 +00:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.12
|
|
|
|
import QtQuick.Controls.impl 2.12
|
|
|
|
import QtGraphicalEffects 1.12
|
|
|
|
import "theme"
|
|
|
|
|
|
|
|
Slider {
|
|
|
|
id: control
|
|
|
|
|
|
|
|
property color buttonColor: Theme.sliderButtonColor
|
|
|
|
property color buttonActiveColor: Theme.defaultButtonActiveColor
|
|
|
|
property color barRightColor: Theme.sliderBarRightColor
|
|
|
|
property color barLeftColor: Theme.sliderBarLeftColor
|
|
|
|
|
|
|
|
background: Rectangle {
|
2020-06-23 23:58:11 +00:00
|
|
|
x: control.leftPadding
|
|
|
|
y: control.topPadding + control.availableHeight / 2 - height / 2
|
|
|
|
implicitWidth: 200
|
|
|
|
implicitHeight: 4
|
|
|
|
width: control.availableWidth
|
|
|
|
height: implicitHeight
|
|
|
|
radius: 2
|
|
|
|
color: control.barRightColor
|
2020-06-04 22:44:02 +00:00
|
|
|
|
2020-06-23 23:58:11 +00:00
|
|
|
Rectangle {
|
|
|
|
width: control.visualPosition * parent.width
|
|
|
|
height: parent.height
|
|
|
|
color: control.barLeftColor
|
|
|
|
radius: 2
|
2020-06-04 22:44:02 +00:00
|
|
|
}
|
2020-06-23 23:58:11 +00:00
|
|
|
}
|
2020-06-04 22:44:02 +00:00
|
|
|
|
|
|
|
handle: Rectangle {
|
|
|
|
x: control.leftPadding + control.visualPosition * (control.availableWidth - width)
|
|
|
|
y: control.topPadding + control.availableHeight / 2 - height / 2
|
|
|
|
implicitWidth: 26 * gcd.themeScale
|
|
|
|
implicitHeight: 26 * gcd.themeScale
|
|
|
|
radius: 13 * gcd.themeScale
|
|
|
|
color: control.pressed ? control.buttonActiveColor : control.buttonColor
|
|
|
|
border.color: control.buttonColor
|
|
|
|
}
|
|
|
|
|
2020-06-23 23:58:11 +00:00
|
|
|
}
|