12-hour clock and hover-dependent cursor
CI / test (push) Successful in 45s

- timefmt.hhmm12 + render_digital(hour12=); compositor panel shows '7:51 PM'
  (wasm clock component keeps 24h by default)
- wp_cursor_shape_v1: server lets clients pick their cursor; nested window
  forwards the shape to the host. Launcher button/entries show a hand, the
  search field a text cursor, client windows what the client asked for.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Sonnet 5.5 committed 2026-11-24 19:51:16 -08:00
1 parent a63f65806d
commit 59ea224d38
8 files changed
+146 -3

No files matched your search

+19 -1
View File
@@ -199,6 +199,24 @@ fn DesktopShell::launch(self : DesktopShell, id : String) -> Result[Unit, String
}
}
///| wp_cursor_shape_v1 value for the shell UI under (x, y): 4 pointer (hand) over the
/// launcher button and popup entries, 9 text over the search field, else 0 (not shell-specific).
pub fn DesktopShell::cursor_at(self : DesktopShell, x : Int, y : Int) -> UInt {
if inside(self.launcher_rect, x, y) {
4U
} else if self.launcher_state.open && inside(self.popup_rect, x, y) {
if self.launcher_state.hover >= 0 {
4U
} else if y - self.popup_rect.y < 52 {
9U
} else {
1U
}
} else {
0U
}
}
///| Pointer press at (x, y). Returns true when the shell consumed it.
pub fn DesktopShell::pointer_down(self : DesktopShell, x : Int, y : Int) -> Bool {
let launch = fn(id : String) { self.launch(id) }
@@ -275,7 +293,7 @@ pub fn DesktopShell::render(
let size = @ui.size(p.w, p.h)
let local : Array[@types.DrawOp] = match p.id {
"launcher" => @launcher.render_button(size, tokens, self.launcher_state)
"clock" => @clock.render_digital(size, tokens, now())
"clock" => @clock.render_digital(size, tokens, now(), hour12=true)
"layout" => [
@ui.fill_rect(@ui.rect(0, 0, p.w, p.h), tokens.palette.surface_hover, radius=tokens.radius.reinterpret_as_int()),
@ui.text(p.w / 2, p.h / 2, layout_label, tokens.font_size.reinterpret_as_int() - 2, tokens.palette.foreground, align=CENTER),