1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-07 05:58:28 -04:00

media: improve album art handling

This commit is contained in:
bbedward
2026-07-08 12:01:33 -04:00
parent e94af2a7aa
commit a62ae336e0
4 changed files with 159 additions and 62 deletions
+6 -6
View File
@@ -26,13 +26,9 @@ Singleton {
readonly property color accentTrack: Theme.withAlpha(accent, 0.28)
readonly property color accentSubtle: Theme.withAlpha(accent, 0.55)
// Plain-named alias: underscore-prefixed props with onChanged handlers crash config load.
readonly property string artUrl: TrackArtService.resolvedArtUrl
onArtUrlChanged: {
if (artUrl === "")
_accent = null;
}
// Hold the last accent across the brief artUrl blank between tracks; never reset to primary.
property var _accent: null
ColorQuantizer {
@@ -40,7 +36,11 @@ Singleton {
source: root.artUrl
depth: 4
rescaleSize: 64
onColorsChanged: root._accent = root._pickAccent(colors)
onColorsChanged: {
const a = root._pickAccent(colors);
if (a !== null)
root._accent = a;
}
}
function _pickAccent(colors) {