- New 'wallpaper' capability (wit/capabilities.wit: wallpapers, current-wallpaper, set-wallpaper) and 'wallpaper' panel module: a button whose popup lists the wallpapers with the current one ticked. Clicking a row switches the desktop at once (the list stays open to compare); Enter picks the highlighted row, Escape or a click elsewhere closes. In the default panel, before Log out. - lib/shell: render_wallpaper(screen, tokens, index) with Plasma glow (the old background), Aurora, Starfield, Dusk and Solid, all draw ops; the themed ones follow a theme swap. - The shell draws the chosen one (the renderer's wallpaper cache redraws it on change) and saves it in state.edn as :wallpaper (:aurora, ...); unknown names fall back to the default. - Served by both hosts: wasmer stub (native) and host-wasm (publish-wallpaper, wallpapers table 5, set-wallpaper request). - Tests: lib/shell wallpaper test, host-wasm module test, native end-to-end test (open, pick, Escape) and a state.edn round trip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hhM8CTYpe2XVYTFQGn
This commit is contained in:
37 files changed
+1311
-78
No files matched your search
@@ -11,7 +11,7 @@
|
||||
|
||||
///| Modules loaded into a fresh panel, in order. `tasks` stretches, so what follows it packs right.
|
||||
let default_panel : Array[String] = [
|
||||
"launcher", "inspector", "layout", "tasks", "moon-disc", "clock-digital12", "logout",
|
||||
"launcher", "inspector", "layout", "tasks", "moon-disc", "clock-digital12", "wallpaper", "logout",
|
||||
]
|
||||
|
||||
///| The module whose popup is the wasm picker.
|
||||
@@ -382,6 +382,15 @@ fn DesktopShell::publish_host_data(self : DesktopShell) -> Unit {
|
||||
}
|
||||
@wasm.publish(Layouts, lt)
|
||||
@wasm.publish_state(self.layout_sel, self.inspect_on)
|
||||
if self.widgets.iter().any(w => w.has_cap("wallpaper")) {
|
||||
let pt = @wasm.Table::new()
|
||||
for n in @libshell.wallpaper_names {
|
||||
pt.str(n)
|
||||
pt.end_row()
|
||||
}
|
||||
@wasm.publish(Wallpapers, pt)
|
||||
@wasm.publish_wallpaper(self.wallpaper_sel)
|
||||
}
|
||||
let it = @wasm.Table::new()
|
||||
for w in self.widgets {
|
||||
it.str(w.slot)
|
||||
@@ -416,6 +425,16 @@ fn DesktopShell::publish_host_data(self : DesktopShell) -> Unit {
|
||||
}
|
||||
}
|
||||
|
||||
///| Show wallpaper `i` (ignored when out of range) and remember it in state.edn.
|
||||
pub fn DesktopShell::set_wallpaper(self : DesktopShell, i : Int) -> Unit {
|
||||
if i < 0 || i >= @libshell.wallpaper_names.length() || i == self.wallpaper_sel {
|
||||
return
|
||||
}
|
||||
self.wallpaper_sel = i
|
||||
@wasm.publish_wallpaper(i)
|
||||
self.save_state()
|
||||
}
|
||||
|
||||
///| Carry out what modules asked of the host during their last calls.
|
||||
fn DesktopShell::process_requests(self : DesktopShell) -> Unit {
|
||||
while true {
|
||||
@@ -436,6 +455,7 @@ fn DesktopShell::process_requests(self : DesktopShell) -> Unit {
|
||||
Some(FocusWindow(n)) => self.actions.push(FocusWindow(n.to_int64().to_uint64()))
|
||||
Some(SetLayout(m)) => self.actions.push(SetLayout(m))
|
||||
Some(Logout) => self.actions.push(Logout)
|
||||
Some(SetWallpaper(i)) => self.set_wallpaper(i)
|
||||
Some(SetInspector(on)) => self.set_inspecting(on)
|
||||
Some(LoadModule(path)) => {
|
||||
match self.load_path(path) {
|
||||
|
||||
Reference in new issue
Block a user