colours: fix flash when change wallpaper
This commit is contained in:
parent
218ee2de95
commit
afd9b0af97
2 changed files with 7 additions and 1 deletions
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue