Files
chandra/components/inspector/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

44 lines
1.1 KiB
MoonBit

///| Implementation of `chandra:desktop/plasmoid` for the Interface Explorer toggle:
/// a panel button that switches the shell's inspect mode on and off.
///|
pub fn info() -> PlasmoidInfo {
{
id: "org.chandra.inspector",
name: "Interface Explorer",
preferred: { w: 110, h: 34 },
min_width: 60,
stretch: false,
}
}
///|
pub fn render(size : @types.Size) -> Array[@types.DrawOp] {
let t = @theme.get_tokens()
let w = size.w.reinterpret_as_int()
let h = size.h.reinterpret_as_int()
let on = @inspector.is_on()
let bg = if on { t.palette.accent } else { t.palette.surface_hover }
let fg = if on { t.palette.accent_foreground } else { t.palette.foreground }
[
@ui.fill_rect(@ui.rect(0, 0, w, h), bg, radius=t.radius.reinterpret_as_int()),
@ui.text(w / 2, h / 2, "Inspect", t.font_size.reinterpret_as_int(), fg, align=CENTER, bold=true),
]
}
///|
pub fn popup() -> PopupSurface? {
None
}
///|
pub fn on_event(target : Surface, event : @types.InputEvent) -> Bool {
match (target, event) {
(WIDGET, PointerDown(_)) => {
@inspector.set_on(!@inspector.is_on())
true
}
_ => false
}
}