diff --git a/quickshell/Modules/Dock/Dock.qml b/quickshell/Modules/Dock/Dock.qml index 4b9160eb..6ca3ec0a 100644 --- a/quickshell/Modules/Dock/Dock.qml +++ b/quickshell/Modules/Dock/Dock.qml @@ -303,22 +303,21 @@ Variants { id: maskItem parent: dock.contentItem visible: false + readonly property bool expanded: dock.reveal x: { const baseX = dockCore.x + dockMouseArea.x; - if (isVertical && SettingsData.dockPosition === SettingsData.Position.Right) { - return baseX - animationHeadroom - borderThickness; - } - return baseX - borderThickness; + if (isVertical && SettingsData.dockPosition === SettingsData.Position.Right) + return baseX - (expanded ? animationHeadroom + borderThickness : 0); + return baseX - (expanded ? borderThickness : 0); } y: { const baseY = dockCore.y + dockMouseArea.y; - if (!isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom) { - return baseY - animationHeadroom - borderThickness; - } - return baseY - borderThickness; + if (!isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom) + return baseY - (expanded ? animationHeadroom + borderThickness : 0); + return baseY - (expanded ? borderThickness : 0); } - width: dockMouseArea.width + (isVertical ? animationHeadroom : 0) + borderThickness * 2 - height: dockMouseArea.height + (!isVertical ? animationHeadroom : 0) + borderThickness * 2 + width: dockMouseArea.width + (isVertical && expanded ? animationHeadroom : 0) + (expanded ? borderThickness * 2 : 0) + height: dockMouseArea.height + (!isVertical && expanded ? animationHeadroom : 0) + (expanded ? borderThickness * 2 : 0) } mask: Region { diff --git a/quickshell/Modules/OSD/MediaPlaybackOSD.qml b/quickshell/Modules/OSD/MediaPlaybackOSD.qml index a5acdc53..e702ed30 100644 --- a/quickshell/Modules/OSD/MediaPlaybackOSD.qml +++ b/quickshell/Modules/OSD/MediaPlaybackOSD.qml @@ -38,6 +38,14 @@ DankOSD { property bool _pendingShow: false + Image { + id: artPreloader + source: TrackArtService._bgArtSource + visible: false + asynchronous: true + cache: true + } + onPlayerChanged: { if (!player) { _pendingShow = false; @@ -48,7 +56,21 @@ DankOSD { Connections { target: TrackArtService function onLoadingChanged() { - if (!TrackArtService.loading && root._pendingShow) { + if (TrackArtService.loading || !root._pendingShow) + return; + if (!TrackArtService._bgArtSource || artPreloader.status !== Image.Loading) { + root._pendingShow = false; + root.show(); + } + } + } + + Connections { + target: artPreloader + function onStatusChanged() { + if (!root._pendingShow || TrackArtService.loading) + return; + if (artPreloader.status !== Image.Loading) { root._pendingShow = false; root.show(); } diff --git a/quickshell/Services/TrackArtService.qml b/quickshell/Services/TrackArtService.qml index cb0e0c2f..d17b73ff 100644 --- a/quickshell/Services/TrackArtService.qml +++ b/quickshell/Services/TrackArtService.qml @@ -24,8 +24,6 @@ Singleton { if (url === _lastArtUrl) return; _lastArtUrl = url; - - _bgArtSource = ""; loading = true; if (!url.startsWith("http://") && !url.startsWith("https://")) { @@ -34,8 +32,7 @@ Singleton { Proc.runCommand("trackart", ["test", "-f", filePath], (output, exitCode) => { if (_lastArtUrl !== localUrl) return; - if (exitCode === 0) - _bgArtSource = localUrl; + _bgArtSource = exitCode === 0 ? localUrl : ""; loading = false; }, 200); return; @@ -50,8 +47,7 @@ Singleton { const resultPath = output.trim(); if (resultPath !== filename) return; - if (exitCode === 0) - _bgArtSource = "file://" + resultPath; + _bgArtSource = exitCode === 0 ? "file://" + resultPath : ""; loading = false; }, 200); } diff --git a/quickshell/Widgets/DankOSD.qml b/quickshell/Widgets/DankOSD.qml index 8c51c0ac..b2187c94 100644 --- a/quickshell/Widgets/DankOSD.qml +++ b/quickshell/Widgets/DankOSD.qml @@ -105,7 +105,7 @@ PanelWindow { } readonly property real dockOffset: { - if (!SettingsData.showDock || SettingsData.dockAutoHide) + if (!SettingsData.showDock || SettingsData.dockAutoHide || SettingsData.dockSmartAutoHide) return 0; return dockThickness + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin; }