Make Background a native feature
- Background replaces the Background Slideshow plugin and the background image of Appearance. It shows a folder as a slideshow, or one image. - It is on by default. Its module loads at launch only when a folder or an image is chosen. - Rust keeps the one folder in background-folder.json. The interface never sends a path. Eight background_* commands replace the six deprecated backgrounds_* commands. - The first start moves the slideshow folder and settings, and keeps the saved image as the image source. - One blur worker with a cache, fewer folder reads, and a decode before each fade. The hub writes only the changed properties. - Remove the deprecated folder methods of api.backgrounds. set, get, and subscribe stay for the Project Management plugin. - Show the view buttons in the workbench test without text, after UI-056. - Update the tests, the measurement tool, the docs, and UI-057.
This commit is contained in:
@@ -9,15 +9,12 @@ export interface BackgroundFrame {
|
||||
transitionMs?: number;
|
||||
}
|
||||
|
||||
/** The folder methods are deprecated. Use `FilesApi` folder grants in new code. */
|
||||
/**
|
||||
* The background frames of each target in one window. A plugin can show a frame and read the current frame.
|
||||
* Use the `FilesApi` folder grants to read image files.
|
||||
*/
|
||||
export interface BackgroundApi {
|
||||
readonly version: 1;
|
||||
chooseFolder(): Promise<string | null>;
|
||||
defaultFolder?(): Promise<string>;
|
||||
list(folder: string): Promise<{ name: string }[]>;
|
||||
read(folder: string, name: string): Promise<Uint8Array>;
|
||||
readImageSettings?(folder: string): Promise<string | null>;
|
||||
writeImageSettings?(folder: string, contents: string, expected: string | null): Promise<void>;
|
||||
set(target: string, frame: BackgroundFrame | null): void;
|
||||
get(target: string): BackgroundFrame | null;
|
||||
subscribe(listener: (target: string) => void): () => void;
|
||||
|
||||
Reference in New Issue
Block a user