Migrate bos-settings from GTK4 to Tauri + Svelte 5
Ports every remaining view (Keybinds, the last one — dual Flat/MultiLayout schema detection, per-action dedicated fields with a raw-JSON fallback for anything not modeled) and removes the now-fully-dead GTK4 crate (root Cargo.toml + src/), leaving src-tauri/ as the single Rust binary crate. Also folds in the UX pass done alongside the migration: responsive multi-column layout instead of a single centered column, chip/dropdown pickers replacing free-typed fields (Wi-Fi networks, Bar style, keyboard layout, tag lists), consistent pill-switch toggles and boxed-list card styling across every page, and a sidebar scroll-chaining fix.
This commit is contained in:
parent
62365ebf10
commit
93c3b88b10
147 changed files with 15804 additions and 7516 deletions
29
frontend/src/lib/theme/index.ts
Normal file
29
frontend/src/lib/theme/index.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// Bridges bread-theme's pywal-derived palette into the webview. Mirrors
|
||||
// bread_theme::gtk::apply_shared()'s two-phase pattern: fetch once at
|
||||
// startup, then keep it live via a backend-pushed event — see
|
||||
// src-tauri/src/commands/theme.rs for the file-watch side of this.
|
||||
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { listen } from "@tauri-apps/api/event";
|
||||
|
||||
const STYLE_ELEMENT_ID = "bread-theme";
|
||||
|
||||
function applyThemeCss(css: string) {
|
||||
let style = document.getElementById(STYLE_ELEMENT_ID);
|
||||
if (!style) {
|
||||
style = document.createElement("style");
|
||||
style.id = STYLE_ELEMENT_ID;
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
style.textContent = css;
|
||||
}
|
||||
|
||||
/** Call once at startup (e.g. from a root `$effect`/`onMount`). */
|
||||
export async function initTheme(): Promise<void> {
|
||||
const css = await invoke<string>("get_theme_css");
|
||||
applyThemeCss(css);
|
||||
|
||||
await listen<string>("theme-changed", (event) => {
|
||||
applyThemeCss(event.payload);
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue