Add an icon size setting (#3)
This commit was merged in pull request #3.
This commit is contained in:
1 parent
3070db4fb4
commit
472a48f4bd
22 files changed
+901
-51
No files matched your search
+32
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user