mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-10 15:52:58 -04:00
dock: fix auto-hide hit area
media osd: fix showing without album art
This commit is contained in:
@@ -303,22 +303,21 @@ Variants {
|
|||||||
id: maskItem
|
id: maskItem
|
||||||
parent: dock.contentItem
|
parent: dock.contentItem
|
||||||
visible: false
|
visible: false
|
||||||
|
readonly property bool expanded: dock.reveal
|
||||||
x: {
|
x: {
|
||||||
const baseX = dockCore.x + dockMouseArea.x;
|
const baseX = dockCore.x + dockMouseArea.x;
|
||||||
if (isVertical && SettingsData.dockPosition === SettingsData.Position.Right) {
|
if (isVertical && SettingsData.dockPosition === SettingsData.Position.Right)
|
||||||
return baseX - animationHeadroom - borderThickness;
|
return baseX - (expanded ? animationHeadroom + borderThickness : 0);
|
||||||
}
|
return baseX - (expanded ? borderThickness : 0);
|
||||||
return baseX - borderThickness;
|
|
||||||
}
|
}
|
||||||
y: {
|
y: {
|
||||||
const baseY = dockCore.y + dockMouseArea.y;
|
const baseY = dockCore.y + dockMouseArea.y;
|
||||||
if (!isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom) {
|
if (!isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom)
|
||||||
return baseY - animationHeadroom - borderThickness;
|
return baseY - (expanded ? animationHeadroom + borderThickness : 0);
|
||||||
}
|
return baseY - (expanded ? borderThickness : 0);
|
||||||
return baseY - borderThickness;
|
|
||||||
}
|
}
|
||||||
width: dockMouseArea.width + (isVertical ? animationHeadroom : 0) + borderThickness * 2
|
width: dockMouseArea.width + (isVertical && expanded ? animationHeadroom : 0) + (expanded ? borderThickness * 2 : 0)
|
||||||
height: dockMouseArea.height + (!isVertical ? animationHeadroom : 0) + borderThickness * 2
|
height: dockMouseArea.height + (!isVertical && expanded ? animationHeadroom : 0) + (expanded ? borderThickness * 2 : 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
mask: Region {
|
mask: Region {
|
||||||
|
|||||||
@@ -38,6 +38,14 @@ DankOSD {
|
|||||||
|
|
||||||
property bool _pendingShow: false
|
property bool _pendingShow: false
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: artPreloader
|
||||||
|
source: TrackArtService._bgArtSource
|
||||||
|
visible: false
|
||||||
|
asynchronous: true
|
||||||
|
cache: true
|
||||||
|
}
|
||||||
|
|
||||||
onPlayerChanged: {
|
onPlayerChanged: {
|
||||||
if (!player) {
|
if (!player) {
|
||||||
_pendingShow = false;
|
_pendingShow = false;
|
||||||
@@ -48,7 +56,21 @@ DankOSD {
|
|||||||
Connections {
|
Connections {
|
||||||
target: TrackArtService
|
target: TrackArtService
|
||||||
function onLoadingChanged() {
|
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._pendingShow = false;
|
||||||
root.show();
|
root.show();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ Singleton {
|
|||||||
if (url === _lastArtUrl)
|
if (url === _lastArtUrl)
|
||||||
return;
|
return;
|
||||||
_lastArtUrl = url;
|
_lastArtUrl = url;
|
||||||
|
|
||||||
_bgArtSource = "";
|
|
||||||
loading = true;
|
loading = true;
|
||||||
|
|
||||||
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
||||||
@@ -34,8 +32,7 @@ Singleton {
|
|||||||
Proc.runCommand("trackart", ["test", "-f", filePath], (output, exitCode) => {
|
Proc.runCommand("trackart", ["test", "-f", filePath], (output, exitCode) => {
|
||||||
if (_lastArtUrl !== localUrl)
|
if (_lastArtUrl !== localUrl)
|
||||||
return;
|
return;
|
||||||
if (exitCode === 0)
|
_bgArtSource = exitCode === 0 ? localUrl : "";
|
||||||
_bgArtSource = localUrl;
|
|
||||||
loading = false;
|
loading = false;
|
||||||
}, 200);
|
}, 200);
|
||||||
return;
|
return;
|
||||||
@@ -50,8 +47,7 @@ Singleton {
|
|||||||
const resultPath = output.trim();
|
const resultPath = output.trim();
|
||||||
if (resultPath !== filename)
|
if (resultPath !== filename)
|
||||||
return;
|
return;
|
||||||
if (exitCode === 0)
|
_bgArtSource = exitCode === 0 ? "file://" + resultPath : "";
|
||||||
_bgArtSource = "file://" + resultPath;
|
|
||||||
loading = false;
|
loading = false;
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readonly property real dockOffset: {
|
readonly property real dockOffset: {
|
||||||
if (!SettingsData.showDock || SettingsData.dockAutoHide)
|
if (!SettingsData.showDock || SettingsData.dockAutoHide || SettingsData.dockSmartAutoHide)
|
||||||
return 0;
|
return 0;
|
||||||
return dockThickness + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin;
|
return dockThickness + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user