1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-26 06:22:50 -05:00

redesign control center

This commit is contained in:
bbedward
2025-08-29 11:48:11 -04:00
parent 64a26aabb8
commit 76181bafff
41 changed files with 2915 additions and 3986 deletions

View File

@@ -154,6 +154,24 @@ Item {
cursorShape: slider.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
enabled: slider.enabled
preventStealing: true
acceptedButtons: Qt.LeftButton
onWheel: function (wheelEvent) {
if (!slider.enabled) return
let delta = wheelEvent.angleDelta.y
let currentValue = slider.value
let step = Math.max(1, (slider.maximum - slider.minimum) / 20)
let newValue
if (delta > 0)
newValue = Math.min(slider.maximum, currentValue + step)
else
newValue = Math.max(slider.minimum, currentValue - step)
newValue = Math.round(newValue)
if (newValue !== slider.value) {
slider.value = newValue
slider.sliderValueChanged(newValue)
}
wheelEvent.accepted = true
}
onPressed: mouse => {
if (slider.enabled) {
slider.isDragging = true