colours: fix flash when change wallpaper

This commit is contained in:
2 * r + 2 * t 2025-06-06 19:17:22 +10:00
parent 218ee2de95
commit afd9b0af97
2 changed files with 7 additions and 1 deletions

View file

@ -12,6 +12,7 @@ Singleton {
readonly property list<string> colourNames: ["rosewater", "flamingo", "pink", "mauve", "red", "maroon", "peach", "yellow", "green", "teal", "sky", "sapphire", "blue", "lavender"] readonly property list<string> colourNames: ["rosewater", "flamingo", "pink", "mauve", "red", "maroon", "peach", "yellow", "green", "teal", "sky", "sapphire", "blue", "lavender"]
property bool showPreview property bool showPreview
property bool endPreviewOnNextChange
property bool light property bool light
readonly property Colours palette: showPreview ? preview : current readonly property Colours palette: showPreview ? preview : current
readonly property Colours current: Colours {} readonly property Colours current: Colours {}
@ -42,6 +43,11 @@ Singleton {
if (colours.hasOwnProperty(name)) if (colours.hasOwnProperty(name))
colours[name] = `#${colour.trim()}`; colours[name] = `#${colour.trim()}`;
} }
if (isPreview && endPreviewOnNextChange) {
showPreview = false;
endPreviewOnNextChange = false;
}
} }
function setMode(mode: string): void { function setMode(mode: string): void {

View file

@ -46,7 +46,7 @@ Singleton {
function stopPreview(): void { function stopPreview(): void {
showPreview = false; showPreview = false;
Colours.showPreview = false; Colours.endPreviewOnNextChange = true;
} }
reloadableId: "wallpapers" reloadableId: "wallpapers"