refactor(icons): centralize icon resolution into Paths.resolveIconPath/resolveIconUrl#1880
Merged
Purian23 merged 1 commit intoAvengeMedia:masterfrom Mar 1, 2026
Conversation
…h/resolveIconUrl Supersedes AvengeMedia#1878. Rather than duplicating the moddedAppId + file path substitution pattern inline across 8 files, this introduces two centralized functions in Paths.qml: - resolveIconPath(iconName): for Quickshell.iconPath() callsites, with DesktopService.resolveIconPath() fallback - resolveIconUrl(iconName): for image://icon/ URL callsites All consumer files now use one-line calls. When no substitutions are configured, moddedAppId() returns the original name unchanged (zero cost), so this has no impact on users who don't use the feature. Affected components: - AppIconRenderer (8 lines → 1) - NotificationCard, NotificationPopup, HistoryNotificationCard - DockContextMenu, AppsDockContextMenu - LauncherContent, LauncherTab (×3)
Purian23
added a commit
that referenced
this pull request
Mar 1, 2026
- Consistent with the appIcon PR changes in #1880.
Collaborator
|
Thanks! |
bbedward
pushed a commit
that referenced
this pull request
Mar 10, 2026
…h/resolveIconUrl (#1880) Supersedes #1878. Rather than duplicating the moddedAppId + file path substitution pattern inline across 8 files, this introduces two centralized functions in Paths.qml: - resolveIconPath(iconName): for Quickshell.iconPath() callsites, with DesktopService.resolveIconPath() fallback - resolveIconUrl(iconName): for image://icon/ URL callsites All consumer files now use one-line calls. When no substitutions are configured, moddedAppId() returns the original name unchanged (zero cost), so this has no impact on users who don't use the feature. Affected components: - AppIconRenderer (8 lines → 1) - NotificationCard, NotificationPopup, HistoryNotificationCard - DockContextMenu, AppsDockContextMenu - LauncherContent, LauncherTab (×3) Co-authored-by: odtgit <odtgit@taliops.com>
bbedward
pushed a commit
that referenced
this pull request
Mar 10, 2026
…nsistent with the appIcon PR changes in #1880.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Supersedes #1878. An audit of all icon resolution paths found 8 components that resolve icons via
Quickshell.iconPath()orimage://icon/URLs without checkingappIdSubstitutions. Rather than adding the same 8-line inline pattern to each file (#1878), this PR centralizes the logic into two new functions inPaths.qml:resolveIconPath(iconName)— forQuickshell.iconPath()callsites, handles substitution + file path detection +DesktopService.resolveIconPath()fallbackresolveIconUrl(iconName)— forimage://icon/URL callsites, same substitution logicAll consumer files now use one-line calls instead of duplicated inline blocks.
Why substitutions are needed
Qt6's
QIcon::fromTheme()has a limitation where it silently resolves some icon names (e.g. PWA icons likechrome-xxx-Default) to the generic browser icon instead of the actual icon installed in~/.local/share/icons/hicolor/. This was confirmed via pixel-level comparison. Icons bundled in the active system theme (e.g. Qogir ships YouTube) work; others don't. This is a Qt upstream issue. TheappIdSubstitutionsfeature lets users map broken icon names to direct file paths, bypassing Qt's theme lookup.Zero cost for non-users
When no substitutions match,
moddedAppId()returns the original icon name unchanged (identity), so the existingQuickshell.iconPath()/image://icon/path executes exactly as before.Files changed (9)
Common/Paths.qmlresolveIconPath(),resolveIconUrl(), simplifygetAppIcon()Widgets/AppIconRenderer.qmlPaths.resolveIconPath()Notifications/Center/NotificationCard.qml(×2)Quickshell.iconPath(appIcon, true)→Paths.resolveIconPath(appIcon)Notifications/Popup/NotificationPopup.qmlNotifications/Center/HistoryNotificationCard.qmlDock/DockContextMenu.qmlDankBar/Widgets/AppsDockContextMenu.qmlModals/DankLauncherV2/LauncherContent.qml"image://icon/" + icon→Paths.resolveIconUrl()Modules/Settings/LauncherTab.qml(×3)Test plan