@@ -273,76 +273,31 @@ ColumnLayout {
273273 anchors .margins : Common .Appearance .spacing .medium
274274 spacing: Common .Appearance .spacing .small
275275
276- // App icon with datacube fallback
276+ // App icon via IconResolver
277277 Item {
278278 id: notifIconContainer
279279 Layout .preferredWidth : 32
280280 Layout .preferredHeight : 32
281281 Layout .alignment : Qt .AlignTop
282282
283- property string iconName: notification .appIcon || " "
284- property string datacubeIcon: " "
285- property bool datacubeQueried: false
283+ // Get icon from IconResolver (triggers async lookup if not cached)
284+ property string resolvedIcon: notification .appName ? Services .IconResolver .getIcon (notification .appName ) : " "
285+ property string fallbackIcon: notification .appIcon || " "
286+ property string iconSource: resolvedIcon || (fallbackIcon ? " image://icon/" + fallbackIcon : " " )
286287
287- Component .onCompleted : {
288- if (notification .appName && ! datacubeQueried) {
289- datacubeQueried = true
290- iconLookup .query = notification .appName
291- iconLookup .running = true
292- }
293- }
294-
295- Process {
296- id: iconLookup
297- property string query: " "
298- command: [" bash" , " -lc" , " datacube-cli query '" + query .replace (/ '/ g , " '\\ ''" ) + " ' --json -m 1" ]
299-
300- stdout: SplitParser {
301- splitMarker: " \n "
302- onRead : data => {
303- if (! data || data .trim () === " " ) return
304- try {
305- const item = JSON .parse (data)
306- if (item .icon ) {
307- if (item .icon .startsWith (" /" )) {
308- notifIconContainer .datacubeIcon = " file://" + item .icon
309- } else {
310- notifIconContainer .datacubeIcon = " image://icon/" + item .icon
311- }
312- }
313- } catch (e) {
314- console .log (" Icon lookup parse error:" , e)
315- }
316- }
317- }
318- }
319-
320- // Primary: Try datacube icon first
321288 Image {
322- id: datacubeNotifIcon
289+ id: notifIcon
323290 anchors .fill : parent
324- source: notifIconContainer .datacubeIcon
291+ source: notifIconContainer .iconSource
325292 sourceSize: Qt .size (32 , 32 )
326293 smooth: true
327294 visible: status === Image .Ready
328295 }
329296
330- // Fallback 1: Qt icon provider
331- Image {
332- id: primaryNotifIcon
333- anchors .fill : parent
334- source: notifIconContainer .iconName && datacubeNotifIcon .status !== Image .Ready
335- ? " image://icon/" + notifIconContainer .iconName
336- : " "
337- sourceSize: Qt .size (32 , 32 )
338- smooth: true
339- visible: datacubeNotifIcon .status !== Image .Ready && status === Image .Ready
340- }
341-
342- // Fallback 2: Letter icon
297+ // Fallback: Letter icon
343298 Rectangle {
344299 anchors .fill : parent
345- visible: datacubeNotifIcon . status !== Image . Ready && primaryNotifIcon .status !== Image .Ready
300+ visible: notifIcon .status !== Image .Ready
346301 radius: Common .Appearance .rounding .small
347302 color: Common .Appearance .m3colors .primaryContainer
348303
0 commit comments