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:
@@ -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 {
|
||||
|
||||
@@ -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 : ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user