1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

media: block scrolling media volume in widget when no player vol avail

This commit is contained in:
bbedward
2025-12-09 23:44:37 -05:00
parent 3e08bac7f3
commit 318c50bc6c
2 changed files with 8 additions and 11 deletions

View File

@@ -49,15 +49,12 @@ BasePill {
}
onWheel: function (wheelEvent) {
if (!activePlayer) {
wheelEvent.accepted = false;
return;
}
wheelEvent.accepted = true;
if (!usePlayerVolume)
return;
const delta = wheelEvent.angleDelta.y;
const currentVolume = usePlayerVolume ? (activePlayer.volume * 100) : ((AudioService.sink?.audio?.volume ?? 0) * 100);
const currentVolume = activePlayer.volume * 100;
let newVolume;
if (delta > 0) {
@@ -66,11 +63,7 @@ BasePill {
newVolume = Math.max(0, currentVolume - 5);
}
if (usePlayerVolume) {
activePlayer.volume = newVolume / 100;
} else if (AudioService.sink?.audio) {
AudioService.sink.audio.volume = newVolume / 100;
}
activePlayer.volume = newVolume / 100;
}
content: Component {

View File

@@ -157,6 +157,8 @@ Item {
anchors.fill: parent
screenName: root.screenName
visible: {
var _ = SessionData.perMonitorWallpaper
var __ = SessionData.monitorWallpapers
var currentWallpaper = SessionData.getMonitorWallpaper(screenName)
return !currentWallpaper || currentWallpaper === "" || (currentWallpaper && currentWallpaper.startsWith("#"))
}
@@ -167,6 +169,8 @@ Item {
anchors.fill: parent
source: {
var _ = SessionData.perMonitorWallpaper
var __ = SessionData.monitorWallpapers
var currentWallpaper = SessionData.getMonitorWallpaper(screenName)
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
}