Fix wallpaper transparency, Recents setup guide, drawer animation, and widget resizing (#2)
This commit was merged in pull request #2.
This commit is contained in:
1 parent
2fa7bd745b
commit
3070db4fb4
15 files changed
+1011
-161
No files matched your search
+102
-12
@@ -22,12 +22,17 @@ fn cell_style(c : @grid.Cell) -> String {
|
||||
}
|
||||
|
||||
///|
|
||||
fn handle(edge : String, e : Edge) -> Node[Msg] {
|
||||
fn handle(edge : String, e : Edge, active : Bool) -> Node[Msg] {
|
||||
el(
|
||||
"span",
|
||||
classes=["resize-handle"],
|
||||
classes=["resize-handle", cls_if("active", active)],
|
||||
attrs=[("data-edge", edge), ("aria-hidden", "true")],
|
||||
handlers={ ..Handlers::none(), down: Some(ResizeBegin(e)), tap: Some(Nop), },
|
||||
handlers={
|
||||
..Handlers::none(),
|
||||
down: Some(ResizeBegin(e)),
|
||||
tap: Some(Nop),
|
||||
press: Some(Nop),
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -42,7 +47,7 @@ fn Model::view_slot(
|
||||
let style = cell_style(cell)
|
||||
match s.kind {
|
||||
Widget => {
|
||||
let live = !self.drawer &&
|
||||
let live = !self.drawer_open() &&
|
||||
self.sheet == NoSheet &&
|
||||
(self.resizing < 0 || i == self.resizing)
|
||||
let attrs = [("data-slot", i.to_string())]
|
||||
@@ -53,9 +58,22 @@ fn Model::view_slot(
|
||||
el("span", classes=["widget-label"], children=[text(s.str)]),
|
||||
]
|
||||
if i == self.resizing {
|
||||
children.push(handle("r", Right))
|
||||
children.push(handle("b", Bottom))
|
||||
children.push(handle("rb", Corner))
|
||||
let lim = self.limits.get(s.wid).unwrap_or(default_limits)
|
||||
let active = match self.resize {
|
||||
Some(r) if r.slot == i => Some(r.edge)
|
||||
_ => None
|
||||
}
|
||||
if lim.h {
|
||||
children.push(handle("l", Left, active == Some(Left)))
|
||||
children.push(handle("r", Right, active == Some(Right)))
|
||||
}
|
||||
if lim.v {
|
||||
children.push(handle("t", Top, active == Some(Top)))
|
||||
children.push(handle("b", Bottom, active == Some(Bottom)))
|
||||
}
|
||||
if lim.h && lim.v {
|
||||
children.push(handle("rb", Corner, active == Some(Corner)))
|
||||
}
|
||||
}
|
||||
Some(
|
||||
el(
|
||||
@@ -165,6 +183,7 @@ fn Model::view_home(self : Model) -> Node[Msg] {
|
||||
}
|
||||
el(
|
||||
"div",
|
||||
key=1,
|
||||
classes=["home"],
|
||||
handlers={
|
||||
..Handlers::none(),
|
||||
@@ -255,7 +274,16 @@ fn Model::view_drawer(self : Model) -> Node[Msg] {
|
||||
} else if tiles.length() == 0 {
|
||||
children.push(el("p", classes=["empty"], children=[text("No apps match.")]))
|
||||
}
|
||||
el("div", classes=["drawer", cls_if("picking", self.picking)], children~)
|
||||
el(
|
||||
"div",
|
||||
key=2,
|
||||
classes=[
|
||||
"drawer",
|
||||
cls_if("picking", self.picking),
|
||||
cls_if("closing", self.drawer_closing),
|
||||
],
|
||||
children~,
|
||||
)
|
||||
}
|
||||
|
||||
///|
|
||||
@@ -379,11 +407,70 @@ fn Model::view_sheet(self : Model) -> Array[Node[Msg]] {
|
||||
)
|
||||
}
|
||||
}
|
||||
RecentsSetup => {
|
||||
items.push(sheet_title("Enable window list"))
|
||||
items.push(
|
||||
el("p", classes=["sheet-copy"], children=[
|
||||
text(
|
||||
"Android only lets accessibility services open Recents, and blocks them on sideloaded apps until you allow restricted settings once (it stays allowed across updates). This service reads nothing on screen.",
|
||||
),
|
||||
]),
|
||||
)
|
||||
items.push(
|
||||
el("ol", classes=["sheet-steps"], children=[
|
||||
el("li", children=[
|
||||
text("Tap "),
|
||||
el("strong", children=[text("Open Accessibility settings")]),
|
||||
text(" and tap "),
|
||||
el("strong", children=[text("ultra Home window list")]),
|
||||
text("."),
|
||||
]),
|
||||
el("li", children=[
|
||||
text("If Android says "),
|
||||
el("strong", children=[text("Restricted setting")]),
|
||||
text(", return here, tap "),
|
||||
el("strong", children=[text("Open App info")]),
|
||||
text(", then tap "),
|
||||
el("strong", children=[text("⋮")]),
|
||||
text(" (or scroll to the bottom on Android 15+) → "),
|
||||
el("strong", children=[text("Allow restricted settings")]),
|
||||
text("."),
|
||||
]),
|
||||
el("li", children=[
|
||||
text("Return to "),
|
||||
el("strong", children=[text("Accessibility settings")]),
|
||||
text(" and turn on "),
|
||||
el("strong", children=[text("ultra Home window list")]),
|
||||
text("."),
|
||||
]),
|
||||
]),
|
||||
)
|
||||
items.push(
|
||||
el("div", classes=["sheet-actions"], children=[
|
||||
el(
|
||||
"button",
|
||||
classes=["btn"],
|
||||
handlers=tap(OpenAccessibilitySettings),
|
||||
children=[text("Open Accessibility settings")],
|
||||
),
|
||||
el(
|
||||
"button",
|
||||
classes=["btn", "secondary"],
|
||||
handlers=tap(OpenSelfAppInfo),
|
||||
children=[text("Open App info")],
|
||||
),
|
||||
el("button", classes=["btn", "ghost"], handlers=tap(CloseSheet), children=[
|
||||
text("Close"),
|
||||
]),
|
||||
]),
|
||||
)
|
||||
}
|
||||
}
|
||||
[
|
||||
el("div", classes=["sheet-overlay"], handlers=tap(CloseSheet)),
|
||||
el("div", key=3, classes=["sheet-overlay"], handlers=tap(CloseSheet)),
|
||||
el(
|
||||
"div",
|
||||
key=4,
|
||||
classes=["sheet"],
|
||||
attrs=[("role", "dialog"), ("aria-modal", "true")],
|
||||
handlers={ ..Handlers::none(), escape: Some(CloseSheet), },
|
||||
@@ -394,7 +481,10 @@ fn Model::view_sheet(self : Model) -> Array[Node[Msg]] {
|
||||
|
||||
///|
|
||||
fn Model::view_resize_bar(self : Model) -> Node[Msg] {
|
||||
el("div", classes=["resize-bar"], attrs=[("role", "toolbar")], children=[
|
||||
let s = self.home[self.resizing]
|
||||
let size = "\{s.cols(self.cols)} × \{s.height()}"
|
||||
el("div", key=5, classes=["resize-bar"], attrs=[("role", "toolbar")], children=[
|
||||
el("span", classes=["resize-size"], children=[text(size)]),
|
||||
el("span", classes=["resize-hint"], children=[
|
||||
text("Drag to move, or drag the handles to resize"),
|
||||
]),
|
||||
@@ -419,12 +509,12 @@ pub fn view(m : Model) -> Array[Node[Msg]] {
|
||||
}
|
||||
if m.sheet != NoSheet {
|
||||
out.append(m.view_sheet())
|
||||
} else if m.resizing >= 0 && !m.drawer {
|
||||
} else if m.resizing >= 0 && !m.drawer_open() {
|
||||
out.push(m.view_resize_bar())
|
||||
}
|
||||
if m.notice != "" {
|
||||
out.push(
|
||||
el("div", classes=["notice"], attrs=[("role", "status")], children=[
|
||||
el("div", key=6, classes=["notice"], attrs=[("role", "status")], children=[
|
||||
text(m.notice),
|
||||
]),
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user