styled slider
This commit is contained in:
parent
a3ef488434
commit
399f69a68a
2 changed files with 46 additions and 0 deletions
33
components/StyledSlider.qml
Normal file
33
components/StyledSlider.qml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import qs.config
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
Slider {
|
||||
id: control
|
||||
|
||||
height: 24
|
||||
|
||||
background: Rectangle {
|
||||
x: control.leftPadding
|
||||
y: control.topPadding + control.availableHeight / 2 - height / 2
|
||||
implicitWidth: 200
|
||||
implicitHeight: control.height
|
||||
width: control.availableWidth
|
||||
height: implicitHeight
|
||||
radius: 8
|
||||
color: Theme.palette.base100
|
||||
|
||||
Rectangle {
|
||||
width: control.visualPosition * parent.width
|
||||
Behavior on width {
|
||||
NumberAnimation {
|
||||
duration: 75
|
||||
}
|
||||
}
|
||||
height: parent.height
|
||||
color: Theme.palette.primary
|
||||
radius: 8
|
||||
}
|
||||
}
|
||||
handle: null
|
||||
}
|
||||
|
|
@ -69,6 +69,19 @@ StyledWindow {
|
|||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
StyledText {
|
||||
text: "Slider"
|
||||
font.pixelSize: 18
|
||||
}
|
||||
StyledSlider {
|
||||
id: slider
|
||||
from: 0
|
||||
to: 100
|
||||
value: 50
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
StyledText {
|
||||
text: "Drawer"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue