Commit 3e80ee13 authored by David Redondo's avatar David Redondo 🏎

Show current Volume in Plasmoid sliders

We draw the background of slider now manually. The length of the highlight
shows the current volume. Minimum is the minimal width of the element,
maximum is highlight up to the handle position and when nothing is playing
no highlight is shown. An animation makes the transitions a bit smoother.
BUG:411563
BUG:428968
parent 227606a7
......@@ -210,6 +210,36 @@ PlasmaComponents.ListItem {
Accessible.name: i18nc("Accessibility data on volume slider", "Adjust volume for %1", defaultButton.text)
background: PlasmaCore.FrameSvgItem {
imagePath: "widgets/slider"
prefix: "groove"
width: parent.availableWidth
height: margins.top + margins.bottom
anchors.centerIn: parent
scale: parent.mirrored ? -1 : 1
PlasmaCore.FrameSvgItem {
imagePath: "widgets/slider"
prefix: "groove-highlight"
anchors.left: parent.left
y: (parent.height - height) / 2
width: Math.max(margins.left + margins.right, slider.handle.x * meter.volume)
height: Math.max(margins.top + margins.bottom, parent.height)
opacity: meter.available && (meter.volume > 0 || animation.running)
VolumeMonitor {
id: meter
target: parent.visible ? PulseObject : null
}
Behavior on width {
NumberAnimation {
id: animation
duration: PlasmaCore.Units.shortDuration
easing.type: Easing.OutQuad
}
}
}
}
Component.onCompleted: {
ignoreValueChange = false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment