From 4e156e1617791326d440723c791113653019c334 Mon Sep 17 00:00:00 2001 From: Justin Mitchell Date: Sun, 21 Jun 2026 01:23:56 -0400 Subject: [PATCH] Scale preview padding in UITheme metrics Apply scaling to previewPadding metric while keeping previewHeightPercent intentionally unscaled. Adds clarifying comment about the different scaling behavior between these two preview-related metrics. --- src/components/UITheme.cpp | 3 +++ src/components/themes/BaseTheme.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/UITheme.cpp b/src/components/UITheme.cpp index 0face08d..1ae0549a 100644 --- a/src/components/UITheme.cpp +++ b/src/components/UITheme.cpp @@ -40,6 +40,9 @@ ThemeMetrics scaleThemeMetrics(const ThemeMetrics& b, float s) { m.batteryBarHeight = sp(b.batteryBarHeight, s); m.headerHeight = sp(b.headerHeight, s); m.verticalSpacing = sp(b.verticalSpacing, s); + // previewPadding is a pixel inset (font preview pane); scaled. previewHeightPercent is a + // percent of the usable height and is intentionally NOT scaled. + m.previewPadding = sp(b.previewPadding, s); m.contentSidePadding = sp(b.contentSidePadding, s); m.listRowHeight = sp(b.listRowHeight, s); m.listWithSubtitleRowHeight = sp(b.listWithSubtitleRowHeight, s); diff --git a/src/components/themes/BaseTheme.h b/src/components/themes/BaseTheme.h index 2b87a0f4..677980bc 100644 --- a/src/components/themes/BaseTheme.h +++ b/src/components/themes/BaseTheme.h @@ -110,7 +110,7 @@ struct ThemeMetrics { // Expected sizeof(ThemeMetrics), in bytes. scaleThemeMetrics() static_asserts // against this so a new/removed metric field can't slip through unclassified; // update it after adding a field (and decide there whether the field scales). -inline constexpr unsigned THEME_METRICS_SIZEOF = 216; +inline constexpr unsigned THEME_METRICS_SIZEOF = 224; enum UIIcon { None = 0, Folder, Text, Image, Book, File, Settings, Transfer, Library, Wifi, Hotspot, Bookmark, Firmware };