Add an icon size setting for the home grid and the app drawer
Launcher / test (pull_request) Successful in 1m29s
Launcher / apk (pull_request) Skipped

Slider (70-160%, step 5) with Small/Medium/Large presets and a live preview in the
home menu. Icon, label and row height scale together; the home and drawer column
counts reflow; the size is saved in localStorage; a corrupt saved value is logged
and shown, not silently replaced. 100% is the original layout.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
SpriteandClaude Sonnet 5.5 committed 2026-11-24 22:32:50 +00:00
1 parent 3070db4fb4
commit 23317b949a
22 files changed
+901 -51

No files matched your search

+32 -1
View File
@@ -61,6 +61,8 @@ pub(all) enum Sheet {
DrawerApp(Int32)
WidgetPicker
RecentsSetup
/// The icon size slider and presets.
IconSize
}
///|
@@ -118,6 +120,19 @@ pub(all) struct Model {
mut grid_left : Double
mut grid_top : Double
mut col_w : Double
/// Icon size in percent of the original (see grid/scale.mbt), applied to the home
/// grid and the drawer.
mut icon_pct : Int32
/// Why the saved icon size could not be used (empty: it could); shown in the icon
/// size sheet. The bad stored value is left alone until a size is chosen.
mut icon_error : String
/// The last measurement, kept so a size change can lay out again without one.
mut vw : Int32
mut grid_w : Double
/// Px of screen below the top of the grid that rows can fill.
mut avail_h : Double
/// Columns of the drawer's app list.
mut drawer_cols : Int32
mut query : String
mut wquery : String
mut drawer : Bool
@@ -176,6 +191,12 @@ pub fn Model::new() -> Model {
grid_left: 0.0,
grid_top: 0.0,
col_w: 0.0,
icon_pct: @grid.scale_default,
icon_error: "",
vw: 0,
grid_w: 0.0,
avail_h: 0.0,
drawer_cols: 4,
query: "",
wquery: "",
drawer: false,
@@ -222,7 +243,7 @@ pub(all) enum Msg {
// ---- from the platform
/// Boot: the saved layout (this app's JSON, and the old WebView build's
/// `ultra.home.*` localStorage as a JSON object), the clock, and the self-update state.
Restore(saved~ : String?, legacy~ : String?)
Restore(saved~ : String?, legacy~ : String?, icon_size~ : String?)
Started(
now~ : Int64,
last_check~ : Int64,
@@ -294,6 +315,12 @@ pub(all) enum Msg {
MoveEarlier(Int32)
InfoOf(Int32)
Settings
/// Open the icon size sheet.
IconSizeMenu
/// The slider's value (text, as the input reports it).
SetIconSize(String)
/// A preset button, in percent.
IconPreset(Int32)
Wallpaper
Recents
RecentsUnavailable
@@ -331,6 +358,10 @@ pub(all) enum Effect {
/// Ask the shell for a widget's limits and answer `LimitsKnown`.
QueryLimits(Int32)
SaveHome(String)
/// Store the icon size (percent).
SaveIconSize(Int32)
/// Write a line to the platform's error log.
LogError(String)
SaveLastCheck(Int64)
/// Send the message after this many ms.
Delay(Int32, Msg)