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.
This commit is contained in:
Justin Mitchell
2026-06-21 01:23:56 -04:00
parent 3e0ba4488b
commit 4e156e1617
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -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);
+1 -1
View File
@@ -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 };