Wasm panel modules, widget host, merged plasmoid host design, and shell/UI work
Panel and wasm host - The panel is built from wasm plasmoid modules (compositor/wasm: wasmer-backed host). Modules get capabilities by importing host interfaces; the host publishes data tables and serves a request queue (launch, focus window, set layout, inspector, load/unload modules). New WIT: windows, layout-control, inspector, modules, system. - Merged two competing host designs: generic tables + requests are the base; the `system` snapshot and the id-stable `windows.all/focus` (Desktop Pulse) run on top of it. - Panel widgets: load a .wasm from a path or file chooser, reorder by dragging, right-click replace/remove/add, saved to panel.edn. - Desktop widget, system sampler (sysinfo), app catalog/humanised names, Interface Explorer (inspector), real font rendering (compositor/font, assets/fonts). Compositor - Drag the divider between tiled windows; lower tiled rows leave room for the title bar. - Title-bar buttons, 12-hour clock, truncated titles, task-list/layout menus. - DRM/KMS session, tcc debug builds (vendored tinycc incl. conftest.c), justfile recipes (modules, run, test), pixi.toml. Known gaps - The sources for the pulse, tasks, layout, inspector, module-manager, moon-* and clock-digital12 modules are not in the tree yet, so `just modules` stops at pulse and the host tests that load those modules fail until they land. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
080377fd79
commit
0145981c6a
57 files changed
+11461
-221
No files matched your search
+15
-7
@@ -56,21 +56,29 @@ pub fn render_binary(
|
||||
]
|
||||
let ops = []
|
||||
let cols = digits.length()
|
||||
let step_x = w / cols
|
||||
// Columns are grouped HH MM SS with a wider gap between groups.
|
||||
let group_gap = 8
|
||||
let step_x = (w - 2 * group_gap) / cols
|
||||
let step_y = h / 4
|
||||
let r = (if step_x < step_y { step_x } else { step_y }) / 2 - 1
|
||||
let lit = t.palette.accent
|
||||
let off = @ui.with_alpha(t.palette.foreground_muted, 70)
|
||||
for c = 0; c < cols; c = c + 1 {
|
||||
let (d, nbits) = digits[c]
|
||||
let bits = @timefmt.bcd_bits(d, nbits)
|
||||
let secs = c >= 4
|
||||
for i = 0; i < nbits; i = i + 1 {
|
||||
// Row 3 is the least significant bit.
|
||||
let row = 4 - nbits + i
|
||||
let cx = c * step_x + step_x / 2
|
||||
let cx = c * step_x + step_x / 2 + (c / 2) * group_gap
|
||||
let cy = row * step_y + step_y / 2
|
||||
if bits[i] {
|
||||
ops.push(@ui.circle(cx, cy, r, t.palette.accent))
|
||||
// Soft halo + solid dot; seconds are quieter so hours/minutes read first.
|
||||
let col = if secs { @ui.with_alpha(lit, 150) } else { lit }
|
||||
ops.push(@ui.circle(cx, cy, r + 2, @ui.with_alpha(lit, if secs { 28 } else { 55 })))
|
||||
ops.push(@ui.circle(cx, cy, r, col))
|
||||
} else {
|
||||
ops.push(@ui.circle(cx, cy, r, t.palette.border, filled=false))
|
||||
ops.push(@ui.circle(cx, cy, r - 1, off))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,12 +148,12 @@ test "digital clock shows HH:MM and the date" {
|
||||
///|
|
||||
test "binary clock draws one dot per displayed bit" {
|
||||
let ops = render_binary(@ui.size(96, 36), test_tokens(), test_time())
|
||||
// 2+4+3+4+3+4 bits
|
||||
assert_eq(ops.length(), 20)
|
||||
// 2+4+3+4+3+4 bits; lit bits draw a halo and a dot
|
||||
assert_eq(ops.length(), 20 + 10)
|
||||
let mut lit = 0
|
||||
for op in ops {
|
||||
match op {
|
||||
Circle(c) => if c.filled { lit += 1 }
|
||||
Circle(c) => if c.filled && c.color.a >= 150 { lit += 1 }
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user