mpris applet reads service directly, fix accent color gradient with pinned dock

This commit is contained in:
Damocles 2026-04-26 13:37:34 +02:00
parent 02910957f1
commit 200a844062
6 changed files with 31 additions and 63 deletions

View file

@ -15,7 +15,8 @@ Item {
if (!scr)
return 0.5;
const gx = mapToGlobal(width / 2, 0).x - scr.x;
return Math.max(0, Math.min(1, gx / scr.width));
const effectiveWidth = scr.width - (S.DockState.reservedWidth ?? 0);
return Math.max(0, Math.min(1, gx / (effectiveWidth > 0 ? effectiveWidth : scr.width)));
}
property color borderColor: Qt.rgba(S.Theme.base0C.r + (S.Theme.base09.r - S.Theme.base0C.r) * _posFrac, S.Theme.base0C.g + (S.Theme.base09.g - S.Theme.base0C.g) * _posFrac, S.Theme.base0C.b + (S.Theme.base09.b - S.Theme.base0C.b) * _posFrac, 1)
property bool leftEdge: false