Colour themes, synced across devices (beta)
Seven themes (Spruce, Ocean, Violet, Rose, Crimson, Amber, Graphite) that change only the brand colour, all AA in light and dark. "Same theme on all my devices" saves the choice in the encrypted vault and adopts it after unlocking and syncing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -408,6 +408,26 @@ fn resolve_save(app: State<'_, App>, id: String, accept: bool) -> CmdResult<()>
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// The colour theme and appearance saved for all the account's devices (docs/02 "App settings").
|
||||
#[derive(Serialize)]
|
||||
struct ThemeView {
|
||||
theme: Option<String>,
|
||||
appearance: Option<String>,
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn app_theme(app: State<'_, App>) -> CmdResult<ThemeView> {
|
||||
let t = app.core.app_theme().map_err(err)?;
|
||||
Ok(ThemeView { theme: t.theme, appearance: t.appearance })
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn set_app_theme(app: State<'_, App>, theme: Option<String>, appearance: Option<String>) -> CmdResult<()> {
|
||||
app.core.set_app_theme(theme, appearance).map_err(err)?;
|
||||
app.sync.request_sync();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn pending_passkeys(app: State<'_, App>) -> Vec<PasskeyView> {
|
||||
app.broker.pending_passkeys()
|
||||
@@ -730,6 +750,8 @@ fn main() {
|
||||
pending_saves,
|
||||
pending_passkeys,
|
||||
set_tags,
|
||||
app_theme,
|
||||
set_app_theme,
|
||||
sign_in_providers,
|
||||
resolve_passkey,
|
||||
resolve_save,
|
||||
|
||||
Reference in New Issue
Block a user