Files
chandra/components/clock-digital12/gen/interface/chandra/desktop/plasmoid/stub.mbt
T
Claude c32a31ffd7
CI / test (push) Failing after 16s
Clock: AM/PM in 12-hour mode, and the default panel clock now has source
clock-digital12 (the default panel's clock) was a prebuilt wasm with no source.
It is now a component built from lib/clock like the Digital Clock, starting in
12-hour mode with AM/PM, and it gets the same right-click Module settings.
Both digital clocks get a "Show AM/PM" switch, offered in 12-hour mode (on by
default).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhrQpz9texRcAtgECq
2026-11-25 19:14:46 +00:00

31 lines
775 B
MoonBit

///| Implementation of `chandra:desktop/plasmoid` for the 12-hour digital clock.
/// All logic lives in lib/clock; this file only adapts host capabilities.
///|
pub fn info() -> PlasmoidInfo {
let (id, name, w, h, min_w) = @logic.digital12_info()
{
id,
name,
preferred: { w: w.reinterpret_as_uint(), h: h.reinterpret_as_uint() },
min_width: min_w.reinterpret_as_uint(),
stretch: false,
}
}
///|
pub fn render(size : @types.Size) -> Array[@types.DrawOp] {
let c = @logic.digital12_config
@logic.render_digital(size, @theme.get_tokens(), @clock.now(), hour12=c.hour12, show_date=c.show_date, ampm=c.ampm)
}
///|
pub fn popup() -> PopupSurface? {
None
}
///|
pub fn on_event(_target : Surface, _event : @types.InputEvent) -> Bool {
false
}