1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 13:32:50 -05:00

media: add scroll wheel behavior configuration (#1160)

This commit is contained in:
xxyangyoulin
2025-12-27 03:43:47 +08:00
committed by GitHub
parent 5ac81e6dd6
commit 1194f3ffb8
4 changed files with 13 additions and 1 deletions

View File

@@ -177,6 +177,7 @@ Singleton {
property bool waveProgressEnabled: true
property bool scrollTitleEnabled: true
property bool audioVisualizerEnabled: true
property bool audioScrollEnabled: true
property bool clockCompactMode: false
property bool focusedWindowCompactMode: false
property bool runningAppsCompactMode: true

View File

@@ -92,6 +92,7 @@ var SPEC = {
waveProgressEnabled: { def: true },
scrollTitleEnabled: { def: true },
audioVisualizerEnabled: { def: true },
audioScrollEnabled: { def: true },
clockCompactMode: { def: false },
focusedWindowCompactMode: { def: false },
runningAppsCompactMode: { def: true },

View File

@@ -52,9 +52,12 @@ BasePill {
property real touchpadThreshold: 100
onWheel: function (wheelEvent) {
wheelEvent.accepted = true;
if (!usePlayerVolume)
return;
if (!SettingsData.audioScrollEnabled)
return;
wheelEvent.accepted = true;
const deltaY = wheelEvent.angleDelta.y;
const isMouseWheelY = Math.abs(deltaY) >= 120 && (Math.abs(deltaY) % 120) === 0;

View File

@@ -43,6 +43,13 @@ Item {
checked: SettingsData.audioVisualizerEnabled
onToggled: checked => SettingsData.set("audioVisualizerEnabled", checked)
}
SettingsToggleRow {
text: I18n.tr("Scroll Wheel")
description: I18n.tr("Scroll on widget changes media volume")
checked: SettingsData.audioScrollEnabled
onToggled: checked => SettingsData.set("audioScrollEnabled", checked)
}
}
}
}