Files
chandra/components/dock/gen/interface/chandra/desktop/plasmoid/stub.mbt
T
VandClaude Opus 5.5 af774d76fe
CI / test (push) Failing after 16s
Rename the project to Chandra
moon-plasma / moonplasma / MoonPlasma / Moon Plasma become chandra / Chandra
everywhere: the WIT package (chandra:desktop, chandra:host, chandra:wm), the
MoonBit module (chandra/desktop) and generated bindings, the Rust host,
identifiers (ChandraCompositor), the session script (chandra-session) and
desktop entry (chandra.desktop), config and data paths
($XDG_CONFIG_HOME/chandra, share/chandra/modules), env vars (CHANDRA_*),
UI strings, docs and tests. The test fixture components are rebuilt against
the renamed WIT.

Saved panel.edn and state.edn are still read from the old
$XDG_CONFIG_HOME/moon-plasma until the first save writes the new copy.

The remote repository keeps its experiments/moon-plasma name for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hi3L9oVBoRd373Qr4n
2026-11-25 17:12:57 +00:00

43 lines
1.2 KiB
MoonBit

///| Implementation of `chandra:desktop/plasmoid` for the dock: a row of app tiles
/// that magnify under the pointer and start the app on click. The tile layout and
/// hit-testing live in lib/dock; this adapts host capabilities.
///| Tile under the pointer, or -1.
let hover : Ref[Int] = Ref::new(-1)
///| Height of the widget at its last render (events carry no size).
let height : Ref[Int] = Ref::new(34)
///|
pub fn info() -> PlasmoidInfo {
{
id: "org.chandra.dock",
name: "Dock",
preferred: { w: @logic.preferred_width(@app_catalog.list_apps().length()).reinterpret_as_uint(), h: 34U },
min_width: 60,
stretch: false,
}
}
///|
pub fn render(size : @types.Size) -> Array[@types.DrawOp] {
height.val = size.h.reinterpret_as_int()
@logic.render(size, @theme.get_tokens(), @app_catalog.list_apps(), hover.val)
}
///| Dock tiles have no popup.
pub fn popup() -> PopupSurface? {
None
}
///|
pub fn on_event(_target : Surface, event : @types.InputEvent) -> Bool {
let (h, redraw, launch) = @logic.handle(@app_catalog.list_apps(), hover.val, height.val, event)
hover.val = h
match launch {
Some(id) => ignore(@app_launch.launch(id))
None => ()
}
redraw
}