1 parent
dccbfd7d86
commit
17f81c60c8
20 files changed
+636
-447
No files matched your search
+69
-51
@@ -22,18 +22,18 @@ pub(all) struct WidgetInfo {
|
||||
/// The label of the app the widget comes from (for the picker's search).
|
||||
app : String
|
||||
/// Natural height in CSS px.
|
||||
h : Int
|
||||
h : Int32
|
||||
}
|
||||
|
||||
///|
|
||||
/// How a widget may be resized, in CSS px (the shell's `widgetLimits`): its natural
|
||||
/// width, min/max size (0: no max), and whether it resizes horizontally / vertically.
|
||||
pub(all) struct Limits {
|
||||
w : Int
|
||||
min_w : Int
|
||||
min_h : Int
|
||||
max_w : Int
|
||||
max_h : Int
|
||||
w : Int32
|
||||
min_w : Int32
|
||||
min_h : Int32
|
||||
max_w : Int32
|
||||
max_h : Int32
|
||||
h : Bool
|
||||
v : Bool
|
||||
}
|
||||
@@ -56,9 +56,9 @@ pub(all) enum Sheet {
|
||||
/// The menu of the empty home.
|
||||
HomeMenu
|
||||
/// The menu of a home slot.
|
||||
Item(Int)
|
||||
Item(Int32)
|
||||
/// The menu of a drawer app (row in the app list).
|
||||
DrawerApp(Int)
|
||||
DrawerApp(Int32)
|
||||
WidgetPicker
|
||||
}
|
||||
|
||||
@@ -75,11 +75,11 @@ pub(all) enum Edge {
|
||||
/// at `left`, `top`.
|
||||
pub(all) struct ResizeDrag {
|
||||
edge : Edge
|
||||
slot : Int
|
||||
slot : Int32
|
||||
left : Double
|
||||
top : Double
|
||||
mut cols : Int
|
||||
mut rows : Int
|
||||
mut cols : Int32
|
||||
mut rows : Int32
|
||||
}
|
||||
|
||||
///|
|
||||
@@ -87,7 +87,7 @@ pub(all) struct ResizeDrag {
|
||||
pub(all) struct Carry {
|
||||
dx : Double
|
||||
dy : Double
|
||||
mut cell : Int
|
||||
mut cell : Int32
|
||||
}
|
||||
|
||||
///|
|
||||
@@ -99,10 +99,10 @@ pub(all) struct Model {
|
||||
mut wloading : Bool
|
||||
/// The home screen, in order.
|
||||
mut home : Array[@grid.Slot]
|
||||
mut next_key : Int
|
||||
mut next_key : Int32
|
||||
/// Grid columns, and rows that fill the screen (0 until the page has measured).
|
||||
mut cols : Int
|
||||
mut nrows : Int
|
||||
mut cols : Int32
|
||||
mut nrows : Int32
|
||||
/// Where the grid is on the screen (px, viewport) and how wide a column is.
|
||||
mut grid_left : Double
|
||||
mut grid_top : Double
|
||||
@@ -116,9 +116,9 @@ pub(all) struct Model {
|
||||
/// The package being uninstalled: its home slot goes when it leaves the app list.
|
||||
mut gone : String
|
||||
/// Home slot picked up by a long press, being dragged.
|
||||
mut lifted : Int
|
||||
mut lifted : Int32
|
||||
/// Widget slot showing resize handles.
|
||||
mut resizing : Int
|
||||
mut resizing : Int32
|
||||
/// The lifted slot was grabbed while showing handles: drop it back into them.
|
||||
mut regrab : Bool
|
||||
mut carry : Carry?
|
||||
@@ -126,13 +126,13 @@ pub(all) struct Model {
|
||||
/// Native widget views report their drags through `NativeDrag`; where it began.
|
||||
mut native_from : (Double, Double)?
|
||||
/// Widget row being added.
|
||||
mut chosen : Int
|
||||
mut limits : Map[Int, Limits]
|
||||
mut chosen : Int32
|
||||
mut limits : Map[Int32, Limits]
|
||||
mut notice : String
|
||||
mut notice_gen : Int
|
||||
mut notice_gen : Int32
|
||||
// ---- self-update
|
||||
mut installed : Int
|
||||
mut declined : Int
|
||||
mut installed : Int32
|
||||
mut declined : Int32
|
||||
mut checking : Bool
|
||||
mut manual_check : Bool
|
||||
mut apk_url : String?
|
||||
@@ -143,7 +143,7 @@ pub(all) struct Model {
|
||||
/// check that follows the touch ignores it.
|
||||
mut dragged : Bool
|
||||
/// A widget just added whose limits will set its starting width.
|
||||
mut fresh : Int
|
||||
mut fresh : Int32
|
||||
mut gesture : @gesture.State
|
||||
}
|
||||
|
||||
@@ -193,10 +193,10 @@ pub fn Model::new() -> Model {
|
||||
|
||||
///|
|
||||
/// The most slots the home screen holds.
|
||||
pub let home_cap : Int = 200
|
||||
pub let home_cap : Int32 = 200
|
||||
|
||||
///|
|
||||
pub let app_cap : Int = 512
|
||||
pub let app_cap : Int32 = 512
|
||||
|
||||
///|
|
||||
#derive(Eq, Debug)
|
||||
@@ -207,31 +207,49 @@ pub(all) enum Msg {
|
||||
/// 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?)
|
||||
Started(now~ : Int64, last_check~ : Int64, declined~ : Int, installed~ : Int)
|
||||
Started(
|
||||
now~ : Int64,
|
||||
last_check~ : Int64,
|
||||
declined~ : Int32,
|
||||
installed~ : Int32,
|
||||
)
|
||||
/// The page measured itself: viewport size, and where the home grid is.
|
||||
Measured(vw~ : Int, vh~ : Int, grid_left~ : Double, grid_top~ : Double, grid_w~ : Double, bottom_pad~ : Double)
|
||||
Measured(
|
||||
vw~ : Int32,
|
||||
vh~ : Int32,
|
||||
grid_left~ : Double,
|
||||
grid_top~ : Double,
|
||||
grid_w~ : Double,
|
||||
bottom_pad~ : Double,
|
||||
)
|
||||
AppsLoaded(String?)
|
||||
WidgetsLoaded(String?)
|
||||
/// The shell's answer to `QueryLimits`.
|
||||
LimitsKnown(Int, String?)
|
||||
LimitsKnown(Int32, String?)
|
||||
/// A package changed: look at the app list again.
|
||||
Reload
|
||||
/// The Home button or intent.
|
||||
GoHome
|
||||
Back
|
||||
WidgetAdded(Int)
|
||||
WidgetAdded(Int32)
|
||||
/// A long press on a native widget view lifts its slot.
|
||||
WidgetMenu(Int)
|
||||
WidgetMenu(Int32)
|
||||
/// A press on the native view of the widget showing handles picks it up.
|
||||
WidgetGrab(Int)
|
||||
WidgetGrab(Int32)
|
||||
NativeDrag(Double, Double)
|
||||
NativeDrop(Bool)
|
||||
/// The swipe the page saw: dx, dy, ms, whether the home is scrolled to the top, and
|
||||
/// whether the drawer's list is at its end.
|
||||
Touch(dx~ : Double, dy~ : Double, ms~ : Int, home_top~ : Bool, list_end~ : Bool)
|
||||
Touch(
|
||||
dx~ : Double,
|
||||
dy~ : Double,
|
||||
ms~ : Int32,
|
||||
home_top~ : Bool,
|
||||
list_end~ : Bool,
|
||||
)
|
||||
ReleaseFetched(String?)
|
||||
VersionFetched(String?)
|
||||
NoticeDone(Int)
|
||||
NoticeDone(Int32)
|
||||
// ---- from handlers
|
||||
Query(String)
|
||||
Clear
|
||||
@@ -239,30 +257,30 @@ pub(all) enum Msg {
|
||||
WClear
|
||||
OpenDrawer
|
||||
CloseDrawer
|
||||
OpenApp(Int)
|
||||
OpenApp(Int32)
|
||||
OpenFirst
|
||||
OpenHome(Int)
|
||||
AddHome(Int)
|
||||
ToggleHome(Int)
|
||||
AppMenu(Int)
|
||||
AppInfoOf(Int)
|
||||
UninstallOf(Int)
|
||||
OpenHome(Int32)
|
||||
AddHome(Int32)
|
||||
ToggleHome(Int32)
|
||||
AppMenu(Int32)
|
||||
AppInfoOf(Int32)
|
||||
UninstallOf(Int32)
|
||||
Menu
|
||||
CloseSheet
|
||||
PickApps
|
||||
PickWidget
|
||||
ChooseWidget(Int)
|
||||
ChooseWidget(Int32)
|
||||
ChooseFirstWidget
|
||||
Remove(Int)
|
||||
Remove(Int32)
|
||||
/// Swap the slot with the one before it.
|
||||
MoveEarlier(Int)
|
||||
InfoOf(Int)
|
||||
MoveEarlier(Int32)
|
||||
InfoOf(Int32)
|
||||
Settings
|
||||
Wallpaper
|
||||
Recents
|
||||
CheckUpdates
|
||||
Lift(Int)
|
||||
Grab(Int)
|
||||
Lift(Int32)
|
||||
Grab(Int32)
|
||||
ResizeBegin(Edge)
|
||||
ResizeDone
|
||||
/// Does nothing; stands in a chain to stop a tap reaching an element below.
|
||||
@@ -279,7 +297,7 @@ pub(all) enum Effect {
|
||||
AppInfo(String)
|
||||
Uninstall(String)
|
||||
AddWidget(String)
|
||||
RemoveWidget(Int)
|
||||
RemoveWidget(Int32)
|
||||
OpenSettings
|
||||
PickWallpaper
|
||||
OpenRecents
|
||||
@@ -288,16 +306,16 @@ pub(all) enum Effect {
|
||||
LoadApps
|
||||
LoadWidgets
|
||||
/// Ask the shell for a widget's limits and answer `LimitsKnown`.
|
||||
QueryLimits(Int)
|
||||
QueryLimits(Int32)
|
||||
SaveHome(String)
|
||||
SaveLastCheck(Int64)
|
||||
/// Send the message after this many ms.
|
||||
Delay(Int, Msg)
|
||||
Delay(Int32, Msg)
|
||||
/// After this many ms, feed `Hold(token)` to `input` (the long-press timer).
|
||||
HoldTimer(Int, Int)
|
||||
HoldTimer(Int32, Int32)
|
||||
FetchRelease(String)
|
||||
FetchVersion(String)
|
||||
InstallApk(String, Int)
|
||||
InstallApk(String, Int32)
|
||||
/// The drawer opened with its search in front: focus it and raise the keyboard.
|
||||
FocusSearch
|
||||
HideKeyboard
|
||||
|
||||
Reference in new issue
Block a user