33 lines
986 B
QML
33 lines
986 B
QML
import QtQuick
|
|
import "."
|
|
|
|
// Sharp-cornered track+fill for OSD volume/brightness and similar level
|
|
// readouts, and the base for slider-style controls in Quick Settings.
|
|
Item {
|
|
id: bar
|
|
|
|
property real value: 0 // 0..1
|
|
property color fillColor: Theme.colors.primary
|
|
|
|
height: 10
|
|
|
|
Rectangle {
|
|
anchors.fill: parent
|
|
color: Theme.colors.surfaceHover
|
|
border.width: Theme.geometry.borderWidth
|
|
border.color: Theme.colors.crust
|
|
clip: true
|
|
|
|
Rectangle {
|
|
width: Math.max(0, parent.width * Math.max(0, Math.min(1, bar.value)) - parent.border.width * 2)
|
|
height: parent.height - parent.border.width * 2
|
|
x: parent.border.width
|
|
y: parent.border.width
|
|
color: bar.fillColor
|
|
|
|
Behavior on width { NumberAnimation { duration: Theme.animation.durationFast } }
|
|
Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } }
|
|
}
|
|
}
|
|
}
|