launcher: fix transition between lists

Also fix wallpaper preview not switching back when using non dynamic scheme
This commit is contained in:
2 * r + 2 * t 2025-06-17 23:02:54 +10:00
parent e373fe0375
commit 491c0f1dbd
3 changed files with 18 additions and 23 deletions

View file

@ -81,7 +81,7 @@ Item {
const currentItem = list.currentList?.currentItem; const currentItem = list.currentList?.currentItem;
if (currentItem) { if (currentItem) {
if (list.showWallpapers) { if (list.showWallpapers) {
if (currentItem.modelData.path !== Wallpapers.actualCurrent) if (Colours.scheme === "dynamic" && currentItem.modelData.path !== Wallpapers.actualCurrent)
Wallpapers.previewColourLock = true; Wallpapers.previewColourLock = true;
Wallpapers.setWallpaper(currentItem.modelData.path); Wallpapers.setWallpaper(currentItem.modelData.path);
root.visibilities.launcher = false; root.visibilities.launcher = false;

View file

@ -52,7 +52,7 @@ Item {
} }
] ]
transitions: Transition { Behavior on state {
SequentialAnimation { SequentialAnimation {
NumberAnimation { NumberAnimation {
target: root target: root
@ -63,27 +63,15 @@ Item {
easing.type: Easing.BezierSpline easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard easing.bezierCurve: Appearance.anim.curves.standard
} }
PropertyAction { PropertyAction {}
targets: [appList, wallpaperList] NumberAnimation {
properties: "active" target: root
} property: "opacity"
ParallelAnimation { from: 0
NumberAnimation { to: 1
target: root duration: Appearance.anim.durations.small
properties: "implicitWidth,implicitHeight" easing.type: Easing.BezierSpline
duration: Appearance.anim.durations.large easing.bezierCurve: Appearance.anim.curves.standard
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
NumberAnimation {
target: root
property: "opacity"
from: 0
to: 1
duration: Appearance.anim.durations.large
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
} }
} }
} }

View file

@ -12,6 +12,8 @@ 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 string scheme
property string flavour
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 {}
@ -37,6 +39,11 @@ Singleton {
const colours = isPreview ? preview : current; const colours = isPreview ? preview : current;
const scheme = JSON.parse(data); const scheme = JSON.parse(data);
if (!isPreview) {
root.scheme = scheme.name;
flavour = scheme.flavour;
}
light = scheme.mode === "light"; light = scheme.mode === "light";
for (const [name, colour] of Object.entries(scheme.colours)) { for (const [name, colour] of Object.entries(scheme.colours)) {