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>
278 lines
5.6 KiB
Plaintext
278 lines
5.6 KiB
Plaintext
// Generated using `moon info`, DON'T EDIT IT
|
|
package "experiments/launcher/app"
|
|
|
|
import {
|
|
"experiments/launcher/gesture",
|
|
"experiments/launcher/grid",
|
|
"experiments/launcher/vdom",
|
|
"moonbitlang/core/debug",
|
|
"moonbitlang/core/ref",
|
|
}
|
|
|
|
// Values
|
|
pub let app_cap : Int32
|
|
|
|
pub let default_limits : Limits
|
|
|
|
pub fn handler_table(Array[@vdom.Node[Msg]]) -> Array[@vdom.Handlers[Msg]]
|
|
|
|
pub let home_cap : Int32
|
|
|
|
pub fn input(Model, Array[@vdom.Handlers[Msg]], @gesture.Input) -> Array[Effect]
|
|
|
|
pub fn key(Model, Array[@vdom.Handlers[Msg]], Array[Int32], Key) -> Array[Effect]
|
|
|
|
pub fn legacy_import(String, @ref.Ref[Int32]) -> Array[@grid.Slot]
|
|
|
|
pub fn load_json(String, @ref.Ref[Int32]) -> Array[@grid.Slot]?
|
|
|
|
pub fn matches_query(String, String) -> Bool
|
|
|
|
pub fn parse_apps(String) -> Array[AppInfo]?
|
|
|
|
pub fn parse_limits(String) -> Limits
|
|
|
|
pub fn parse_widgets(String) -> Array[WidgetInfo]?
|
|
|
|
pub fn save_json(Array[@grid.Slot]) -> String
|
|
|
|
pub fn typed(Model, Array[@vdom.Handlers[Msg]], Array[Int32], String) -> Array[Effect]
|
|
|
|
pub fn update(Model, Msg) -> Array[Effect]
|
|
|
|
pub fn view(Model) -> Array[@vdom.Node[Msg]]
|
|
|
|
// Errors
|
|
|
|
// Types and methods
|
|
pub(all) struct AppInfo {
|
|
label : String
|
|
component : String
|
|
icon : String
|
|
system : Bool
|
|
}
|
|
|
|
pub(all) struct Carry {
|
|
dx : Double
|
|
dy : Double
|
|
mut cell : Int32
|
|
}
|
|
|
|
#derive(Eq, @debug.Debug)
|
|
pub(all) enum Edge {
|
|
Left
|
|
Right
|
|
Top
|
|
Bottom
|
|
Corner
|
|
}
|
|
|
|
#derive(Eq, @debug.Debug)
|
|
pub(all) enum Effect {
|
|
Launch(String)
|
|
AppInfo(String)
|
|
Uninstall(String)
|
|
AddWidget(String)
|
|
RemoveWidget(Int32)
|
|
OpenSettings
|
|
PickWallpaper
|
|
OpenRecents
|
|
OpenAccessibilitySettings
|
|
OpenSelfAppInfo
|
|
Haptic
|
|
LoadApps
|
|
LoadWidgets
|
|
QueryLimits(Int32)
|
|
SaveHome(String)
|
|
SaveIconSize(Int32)
|
|
LogError(String)
|
|
SaveLastCheck(Int64)
|
|
Delay(Int32, Msg)
|
|
HoldTimer(Int32, Int32)
|
|
FetchRelease(String)
|
|
FetchVersion(String)
|
|
InstallApk(String, Int32)
|
|
FocusSearch
|
|
HideKeyboard
|
|
ScrollTop
|
|
}
|
|
|
|
pub(all) enum Key {
|
|
Enter
|
|
Escape
|
|
}
|
|
|
|
pub(all) struct Limits {
|
|
w : Int32
|
|
min_w : Int32
|
|
min_h : Int32
|
|
max_w : Int32
|
|
max_h : Int32
|
|
h : Bool
|
|
v : Bool
|
|
}
|
|
|
|
pub(all) struct Model {
|
|
mut apps : Array[AppInfo]
|
|
mut loading : Bool
|
|
mut load_error : String
|
|
mut widgets : Array[WidgetInfo]
|
|
mut wloading : Bool
|
|
mut home : Array[@grid.Slot]
|
|
mut next_key : Int32
|
|
mut cols : Int32
|
|
mut nrows : Int32
|
|
mut grid_left : Double
|
|
mut grid_top : Double
|
|
mut col_w : Double
|
|
mut icon_pct : Int32
|
|
mut icon_error : String
|
|
mut vw : Int32
|
|
mut grid_w : Double
|
|
mut avail_h : Double
|
|
mut drawer_cols : Int32
|
|
mut query : String
|
|
mut wquery : String
|
|
mut drawer : Bool
|
|
mut drawer_closing : Bool
|
|
mut drawer_gen : Int32
|
|
mut picking : Bool
|
|
mut sheet : Sheet
|
|
mut gone : String
|
|
mut lifted : Int32
|
|
mut resizing : Int32
|
|
mut regrab : Bool
|
|
mut carry : Carry?
|
|
mut resize : ResizeDrag?
|
|
mut native_from : (Double, Double)?
|
|
mut chosen : Int32
|
|
mut limits : Map[Int32, Limits]
|
|
mut notice : String
|
|
mut notice_gen : Int32
|
|
mut installed : Int32
|
|
mut declined : Int32
|
|
mut checking : Bool
|
|
mut manual_check : Bool
|
|
mut apk_url : String?
|
|
mut release_tag : String
|
|
mut saved : String
|
|
mut dragged : Bool
|
|
mut fresh : Int32
|
|
mut gesture : @gesture.State
|
|
}
|
|
pub fn Model::app_row(Self, String) -> Int32
|
|
pub fn Model::cell_h(Self) -> Int32
|
|
pub fn Model::drawer_open(Self) -> Bool
|
|
pub fn Model::first_match(Self) -> Int32
|
|
pub fn Model::first_widget_match(Self) -> Int32
|
|
pub fn Model::hidden(Self, Int32) -> Bool
|
|
pub fn Model::home_of(Self, Int32) -> Int32
|
|
pub fn Model::icon_keys(Self) -> Array[String]
|
|
pub fn Model::new() -> Self
|
|
pub fn Model::packed(Self) -> @grid.Packed
|
|
pub fn Model::slot_of_widget(Self, Int32) -> Int32
|
|
pub fn Model::widget_matches(Self, Int32) -> Bool
|
|
|
|
#derive(Eq, @debug.Debug)
|
|
pub(all) enum Msg {
|
|
Restore(saved~ : String?, legacy~ : String?, icon_size~ : String?)
|
|
Started(now~ : Int64, last_check~ : Int64, declined~ : Int32, installed~ : Int32)
|
|
Measured(vw~ : Int32, vh~ : Int32, grid_left~ : Double, grid_top~ : Double, grid_w~ : Double, bottom_pad~ : Double, scroll_y~ : Double)
|
|
AppsLoaded(String?)
|
|
WidgetsLoaded(String?)
|
|
LimitsKnown(Int32, String?)
|
|
Reload
|
|
GoHome
|
|
Back
|
|
WidgetAdded(Int32)
|
|
WidgetMenu(Int32)
|
|
WidgetGrab(Int32)
|
|
NativeDrag(Double, Double)
|
|
NativeDrop(Bool)
|
|
Touch(dx~ : Double, dy~ : Double, ms~ : Int32, home_top~ : Bool, list_end~ : Bool)
|
|
ReleaseFetched(String?)
|
|
VersionFetched(String?)
|
|
NoticeDone(Int32)
|
|
Query(String)
|
|
Clear
|
|
WQuery(String)
|
|
WClear
|
|
OpenDrawer
|
|
CloseDrawer
|
|
DrawerClosed(Int32)
|
|
OpenApp(Int32)
|
|
OpenFirst
|
|
OpenHome(Int32)
|
|
AddHome(Int32)
|
|
ToggleHome(Int32)
|
|
AppMenu(Int32)
|
|
AppInfoOf(Int32)
|
|
UninstallOf(Int32)
|
|
Menu
|
|
CloseSheet
|
|
PickApps
|
|
PickWidget
|
|
ChooseWidget(Int32)
|
|
ChooseFirstWidget
|
|
Remove(Int32)
|
|
MoveEarlier(Int32)
|
|
InfoOf(Int32)
|
|
Settings
|
|
IconSizeMenu
|
|
SetIconSize(String)
|
|
IconPreset(Int32)
|
|
Wallpaper
|
|
Recents
|
|
RecentsUnavailable
|
|
OpenAccessibilitySettings
|
|
OpenSelfAppInfo
|
|
CheckUpdates
|
|
Lift(Int32)
|
|
Grab(Int32)
|
|
ResizeBegin(Edge)
|
|
ResizeDone
|
|
Nop
|
|
Dragged(x~ : Double, y~ : Double, x0~ : Double, y0~ : Double)
|
|
Released(moved~ : Bool, held~ : Bool)
|
|
}
|
|
|
|
pub(all) struct ResizeDrag {
|
|
edge : Edge
|
|
slot : Int32
|
|
left : Double
|
|
top : Double
|
|
right : Double
|
|
bottom : Double
|
|
anchor_col : Int32
|
|
anchor_row : Int32
|
|
right_col : Int32
|
|
bottom_row : Int32
|
|
mut col : Int32
|
|
mut row : Int32
|
|
mut cols : Int32
|
|
mut rows : Int32
|
|
}
|
|
|
|
#derive(Eq, @debug.Debug)
|
|
pub(all) enum Sheet {
|
|
NoSheet
|
|
HomeMenu
|
|
Item(Int32)
|
|
DrawerApp(Int32)
|
|
WidgetPicker
|
|
RecentsSetup
|
|
IconSize
|
|
}
|
|
|
|
pub(all) struct WidgetInfo {
|
|
label : String
|
|
provider : String
|
|
icon : String
|
|
app : String
|
|
h : Int32
|
|
}
|
|
|
|
// Type aliases
|
|
|
|
// Traits
|