internal: update for scripts overhaul (#45)
* colours: update for scheme refactor * notifs: match expand anim to container * wallpapers: update current path * wallpapers: update valid wall extensions
This commit is contained in:
commit
388a6217ed
3 changed files with 15 additions and 17 deletions
|
|
@ -93,7 +93,10 @@ StyledRect {
|
||||||
implicitHeight: root.nonAnimHeight
|
implicitHeight: root.nonAnimHeight
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
Behavior on implicitHeight {
|
||||||
Anim {}
|
Anim {
|
||||||
|
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
||||||
|
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
|
|
|
||||||
|
|
@ -36,12 +36,14 @@ Singleton {
|
||||||
|
|
||||||
function load(data: string, isPreview: bool): void {
|
function load(data: string, isPreview: bool): void {
|
||||||
const colours = isPreview ? preview : current;
|
const colours = isPreview ? preview : current;
|
||||||
for (const line of data.trim().split("\n")) {
|
const scheme = JSON.parse(data);
|
||||||
let [name, colour] = line.split(" ");
|
|
||||||
name = name.trim();
|
light = scheme.mode === "light";
|
||||||
name = colourNames.includes(name) ? name : `m3${name}`;
|
|
||||||
if (colours.hasOwnProperty(name))
|
for (const [name, colour] of Object.entries(scheme.colours)) {
|
||||||
colours[name] = `#${colour.trim()}`;
|
const propName = colourNames.includes(name) ? name : `m3${name}`;
|
||||||
|
if (colours.hasOwnProperty(propName))
|
||||||
|
colours[propName] = `#${colour}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isPreview || (isPreview && endPreviewOnNextChange)) {
|
if (!isPreview || (isPreview && endPreviewOnNextChange)) {
|
||||||
|
|
@ -60,14 +62,7 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
path: `${Paths.state}/scheme/current-mode.txt`
|
path: `${Paths.state}/scheme.json`
|
||||||
watchChanges: true
|
|
||||||
onFileChanged: reload()
|
|
||||||
onLoaded: root.light = text() === "light"
|
|
||||||
}
|
|
||||||
|
|
||||||
FileView {
|
|
||||||
path: `${Paths.state}/scheme/current.txt`
|
|
||||||
watchChanges: true
|
watchChanges: true
|
||||||
onFileChanged: reload()
|
onFileChanged: reload()
|
||||||
onLoaded: root.load(text(), false)
|
onLoaded: root.load(text(), false)
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import QtQuick
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property string currentNamePath: `${Paths.state}/wallpaper/last.txt`.slice(7)
|
readonly property string currentNamePath: `${Paths.state}/wallpaper/path.txt`.slice(7)
|
||||||
readonly property string path: `${Paths.pictures}/Wallpapers`.slice(7)
|
readonly property string path: `${Paths.pictures}/Wallpapers`.slice(7)
|
||||||
|
|
||||||
readonly property list<Wallpaper> list: wallpapers.instances
|
readonly property list<Wallpaper> list: wallpapers.instances
|
||||||
|
|
@ -97,7 +97,7 @@ Singleton {
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
running: true
|
running: true
|
||||||
command: ["fd", ".", root.path, "-t", "f", "-e", "jpg", "-e", "jpeg", "-e", "png", "-e", "svg"]
|
command: ["fd", ".", root.path, "-t", "f", "-e", "jpg", "-e", "jpeg", "-e", "png", "-e", "webp", "-e", "tif", "-e", "tiff"]
|
||||||
stdout: SplitParser {
|
stdout: SplitParser {
|
||||||
splitMarker: ""
|
splitMarker: ""
|
||||||
onRead: data => wallpapers.model = data.trim().split("\n")
|
onRead: data => wallpapers.model = data.trim().split("\n")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue