diff --git a/quickshell/Modules/Settings/PluginCard.qml b/quickshell/Modules/Settings/PluginCard.qml index 23b9a290c..a45dd0875 100644 --- a/quickshell/Modules/Settings/PluginCard.qml +++ b/quickshell/Modules/Settings/PluginCard.qml @@ -13,7 +13,8 @@ DCard { property bool installed: false property bool selected: false property string fallbackIcon: "extension" - property string previewSource: PluginService.previewUrl(plugin) + property string previewSource: PluginService.thumbUrl(plugin) + property string previewFallback: PluginService.previewUrl(plugin) property var badges: PluginService.badgeModel(plugin) property bool allowUninstall: false property var palette: null @@ -50,12 +51,20 @@ DCard { CachingImage { id: cardPreview + + property bool useFallback: false + anchors.fill: parent - imagePath: root.previewSource + imagePath: useFallback ? root.previewFallback : root.previewSource maxCacheSize: 640 fillMode: Image.PreserveAspectCrop animate: false visible: status === Image.Ready + onStatusChanged: { + if (status !== Image.Error || useFallback || !root.previewFallback || root.previewFallback === root.previewSource) + return; + useFallback = true; + } } DIcon { diff --git a/quickshell/Modules/Settings/ThemeBrowser.qml b/quickshell/Modules/Settings/ThemeBrowser.qml index 773cb51eb..f6bb57221 100644 --- a/quickshell/Modules/Settings/ThemeBrowser.qml +++ b/quickshell/Modules/Settings/ThemeBrowser.qml @@ -372,6 +372,7 @@ RegistryBrowserWindow { busy: !!root.pendingThemes[cardCell.modelData.id] fallbackIcon: "palette" previewSource: root.themePreviewUrl(cardCell.modelData) + previewFallback: "" badges: root.themeBadges(cardCell.modelData) palette: root.themePalette(cardCell.modelData) allowUninstall: true diff --git a/quickshell/Services/PluginService.qml b/quickshell/Services/PluginService.qml index 775969dad..f07a3e3d0 100644 --- a/quickshell/Services/PluginService.qml +++ b/quickshell/Services/PluginService.qml @@ -1294,6 +1294,17 @@ Singleton { return plugin.screenshot || ""; } + // 16:10 screenshot-only render; the full preview card bakes in title text the card already shows + function thumbUrl(plugin) { + if (!plugin) + return ""; + if (plugin.thumbUrl) + return plugin.thumbUrl; + if (plugin.id) + return previewApiBase + plugin.id + "/thumb"; + return ""; + } + function heroUrl(plugin) { if (!plugin) return "";