feat(app): add configurable global background wallpaper
This commit is contained in:
1 parent
5fb667716f
commit
39aa663ebf
28 files changed
+1240
-1
No files matched your search
@@ -326,6 +326,10 @@ export const loadPinnedTreeNodeIds = forward("loadPinnedTreeNodeIds");
|
||||
export const savePinnedTreeNodeIds = forward("savePinnedTreeNodeIds");
|
||||
export const loadEditorSettings = forward("loadEditorSettings");
|
||||
export const saveEditorSettings = forward("saveEditorSettings");
|
||||
export const saveBackgroundImage = forward("saveBackgroundImage");
|
||||
export const clearBackgroundImage = forward("clearBackgroundImage");
|
||||
export const readBackgroundImage = forward("readBackgroundImage");
|
||||
export const checkBackgroundImage = forward("checkBackgroundImage");
|
||||
export const loadOpenTabsState = forward("loadOpenTabsState");
|
||||
export const saveOpenTabsState = forward("saveOpenTabsState");
|
||||
export const saveDetachedTabHandoff = forward("saveDetachedTabHandoff");
|
||||
|
||||
@@ -1881,6 +1881,28 @@ export async function saveEditorSettings(settings: unknown): Promise<void> {
|
||||
await saveBrowserAppState("editor_settings", settings);
|
||||
}
|
||||
|
||||
// Background images are desktop-only: the web backend has no local data dir.
|
||||
export interface BackgroundImageInfo {
|
||||
storedPath: string;
|
||||
fileName: string;
|
||||
}
|
||||
|
||||
export async function saveBackgroundImage(_sourcePath: string): Promise<BackgroundImageInfo> {
|
||||
throw new Error("Background images are only supported in the desktop app");
|
||||
}
|
||||
|
||||
export async function clearBackgroundImage(_storedPath: string): Promise<void> {
|
||||
throw new Error("Background images are only supported in the desktop app");
|
||||
}
|
||||
|
||||
export async function readBackgroundImage(_storedPath: string): Promise<string> {
|
||||
throw new Error("Background images are only supported in the desktop app");
|
||||
}
|
||||
|
||||
export async function checkBackgroundImage(_storedPath: string): Promise<boolean> {
|
||||
throw new Error("Background images are only supported in the desktop app");
|
||||
}
|
||||
|
||||
export async function loadOpenTabsState(): Promise<OpenTabsStatePayload | null> {
|
||||
const value = await loadBrowserAppState("open_tabs");
|
||||
if (!value || typeof value !== "object") return null;
|
||||
|
||||
@@ -740,6 +740,27 @@ export async function saveEditorSettings(settings: unknown): Promise<void> {
|
||||
return invoke("save_editor_settings", { settings });
|
||||
}
|
||||
|
||||
export interface BackgroundImageInfo {
|
||||
storedPath: string;
|
||||
fileName: string;
|
||||
}
|
||||
|
||||
export async function saveBackgroundImage(sourcePath: string): Promise<BackgroundImageInfo> {
|
||||
return invoke("save_background_image", { sourcePath });
|
||||
}
|
||||
|
||||
export async function clearBackgroundImage(storedPath: string): Promise<void> {
|
||||
return invoke("clear_background_image", { storedPath });
|
||||
}
|
||||
|
||||
export async function readBackgroundImage(storedPath: string): Promise<string> {
|
||||
return invoke("read_background_image", { storedPath });
|
||||
}
|
||||
|
||||
export async function checkBackgroundImage(storedPath: string): Promise<boolean> {
|
||||
return invoke("check_background_image", { storedPath });
|
||||
}
|
||||
|
||||
export async function loadOpenTabsState(): Promise<OpenTabsStatePayload | null> {
|
||||
return invoke("load_open_tabs_state");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user