Give glyph notifications with bodies the large icon slot

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-07-19 21:17:04 -07:00
co-authored by Claude Fable 5
parent 8147489f1d
commit e96163c075
3 changed files with 8 additions and 7 deletions
@@ -53,8 +53,8 @@ function glyphFromHints(hints) {
return ""
}
function shouldRenderCompactGlyph(glyph, iconSource) {
return String(glyph || "").length > 0 && String(iconSource || "").length === 0
function shouldRenderCompactGlyph(glyph, iconSource, singleLineToast) {
return String(glyph || "").length > 0 && String(iconSource || "").length === 0 && !!singleLineToast
}
function snapshotOf(notification, timestamp) {
@@ -38,7 +38,7 @@ BorderSurface {
// The `check` flag avoids Qt's missing-texture placeholder for unknown names.
readonly property string smallIconSource: image.length > 0 ? image : iconSource(appIcon)
readonly property bool hasGlyph: glyph.length > 0
readonly property bool compactGlyph: NotificationLogic.shouldRenderCompactGlyph(glyph, smallIconSource)
readonly property bool compactGlyph: NotificationLogic.shouldRenderCompactGlyph(glyph, smallIconSource, singleLineToast)
readonly property bool hasSmallIcon: smallIconSource.length > 0
readonly property bool summaryStartsWithGlyph: NotificationLogic.summaryStartsWithGlyph(summary)
readonly property bool singleLineToast: sanitizedBody.length === 0
@@ -109,7 +109,7 @@ BorderSurface {
// Hide the slot when the icon failed to resolve (themed-icon name
// not in the user's icon theme) AND we don't have a glyph fallback
// — prevents rendering Qt's pink broken-image placeholder.
visible: !root.collapseRedundantIcon && !root.compactGlyph && root.hasSmallIcon && (root.hasGlyph || smallIconImage.status !== Image.Error)
visible: !root.collapseRedundantIcon && !root.compactGlyph && (root.hasSmallIcon || root.hasGlyph) && (root.hasGlyph || smallIconImage.status !== Image.Error)
Image {
id: smallIconImage
@@ -131,7 +131,7 @@ BorderSurface {
text: root.glyph
color: Color.notifications.text
font.family: root.fontFamily
font.pixelSize: Style.font.iconLarge
font.pixelSize: Style.font.displayLarge
}
}