diff --git a/app/ui/dashboard/settings-menus.ts b/app/ui/dashboard/settings-menus.ts index f261bd58..56142f2e 100644 --- a/app/ui/dashboard/settings-menus.ts +++ b/app/ui/dashboard/settings-menus.ts @@ -241,6 +241,8 @@ function settingsSections(): SettingsSection[] { * stable list between paints. */ function customizationRows(): () => MenuItem[] { + // Opens the modal font picker (face, weight, size) for UI text. + const font = uiFontPickerMenuItem(); // Left / right / bottom edge, or popup; the dashboard controller moves or // resizes windows on change. const position = enumSettingMenuItem(appSwitcherPositionSetting); @@ -261,12 +263,10 @@ function customizationRows(): () => MenuItem[] { animationsMenuItem(), // Controls the top-bar clock (24-hour vs 12-hour). enumSettingMenuItem(timeFormatSetting), - // Opens the modal font picker (face, weight, size) for UI text. - uiFontPickerMenuItem(), ]; - const bottomRows = [position, depth, statusBar, ...rest]; - const popupRows = [position, depth, statusBar, statusBarVisibility, windowBorder, ...rest]; - const sideRows = [position, ...rest]; + const bottomRows = [font, position, depth, statusBar, ...rest]; + const popupRows = [font, position, depth, statusBar, statusBarVisibility, windowBorder, ...rest]; + const sideRows = [font, position, ...rest]; return () => { switch (appSwitcherPositionSetting.get()) { case "bottom": diff --git a/app/ui/notifications.ts b/app/ui/notifications.ts index 37bae622..3a3da2ba 100644 --- a/app/ui/notifications.ts +++ b/app/ui/notifications.ts @@ -3,7 +3,7 @@ import { formatRelativeTime } from "~/util/date-util"; import { getDefaultSmallFont } from "../graphics/ui-fonts"; import { truncateText, wrapText } from "../graphics/textwrap"; import { GrayImage, type UiFont } from "../graphics/image"; -import { LIST_ROW_TEXT_INSET, lineStep, listRowHeight } from "./metrics"; +import { LIST_ROW_TEXT_INSET, centeredTextY, lineStep, listRowHeight } from "./metrics"; import { ALL_NOTIFICATIONS, dismissNotification, @@ -20,8 +20,6 @@ import { type InputEvent } from "./gestures"; import { type Layer, type LayerContext, type PaintBelow } from "./layers"; import { Menu, type MenuBox } from "./menu-core"; -const PAGE_X = 12; -const PAGE_Y = 12; // Title position, shared with the other list apps (terminal, calendar). const TITLE_X = 18; const TITLE_Y = 10; @@ -42,6 +40,10 @@ const DETAIL_MENU_ROW_GAP = 3; const DETAIL_MENU_TEXT_X = 8; const DETAIL_MENU_TEXT_Y = 4; const DETAIL_CONTENT_X = 24; +const DETAIL_TITLE_Y = 21; +/** Gaps below the title's line box and below the icon/app-name header row. */ +const DETAIL_HEADER_GAP = 3; +const DETAIL_BODY_GAP = 4; // Disable-source confirmation: actions on top, the explanation below them. const CONFIRM_X = 24; const CONFIRM_Y = 8; @@ -428,13 +430,17 @@ function drawDetailContent( const contentX = DETAIL_CONTENT_X; const menuX = width - DETAIL_MENU_WIDTH - 24; const contentWidth = menuX - contentX - 20; - image.drawText(font, PAGE_X + 12, PAGE_Y + 9, "Notification", 220); + image.drawText(font, contentX, DETAIL_TITLE_Y, "Notification", 220); + // The header row (icon + app name) and the body stack below the title's + // line box, so a large UI font pushes them down instead of overlapping. + const headerTop = DETAIL_TITLE_Y + font.lineHeight + DETAIL_HEADER_GAP; + const headerHeight = Math.max(ICON_SIZE, font.lineHeight); let appLineX = contentX; if (icon) { - image.bitBlt(icon, contentX, 36, { transparentZero: true }); + image.bitBlt(icon, contentX, headerTop + ((headerHeight - ICON_SIZE) >> 1), { transparentZero: true }); appLineX = contentX + ICON_SIZE + ICON_TEXT_GAP; } - image.drawText(font, appLineX, 42, `${notification.appName || notification.packageName} ${formatRelativeTime(notification.postTime)}`, 150); + image.drawText(font, appLineX, centeredTextY(font, headerTop, headerHeight), `${notification.appName || notification.packageName} ${formatRelativeTime(notification.postTime)}`, 150); const lines: string[] = []; lines.push(...wrapText(font, notification.title || "(untitled)", contentWidth)); @@ -450,7 +456,7 @@ function drawDetailContent( } const step = lineStep(font); - const bodyTop = 48 + font.lineHeight + 4; + const bodyTop = headerTop + headerHeight + DETAIL_BODY_GAP; const maxLines = Math.max(1, ((height - bodyTop - step) / step) | 0); for (let index = 0; index < Math.min(lines.length, maxLines); index++) { const line = lines[index]!;