From 5814fd9696463c7279612b57f24b1c384d10d91e Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 4 Mar 2021 12:35:58 +0100 Subject: [PATCH] apporder reflects favorites keep in sync the first items of apporder which will always be favorites. this should fix the favorites spontaeous reordering that sometimes happen --- .../homescreen/package/contents/ui/main.qml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/containments/homescreen/package/contents/ui/main.qml b/containments/homescreen/package/contents/ui/main.qml index f88e5941..2d8ede7a 100644 --- a/containments/homescreen/package/contents/ui/main.qml +++ b/containments/homescreen/package/contents/ui/main.qml @@ -67,6 +67,12 @@ Item { //END functions + + FastBlur { + anchors.fill: parent + source: wallpaper + radius: 32 + } property bool componentComplete: false onWidthChanged: recalculateMaxFavoriteCount() onHeightChanged:recalculateMaxFavoriteCount() @@ -245,8 +251,9 @@ Item { return; } - plasmoid.nativeInterface.applicationListModel.addFavorite(storageId, 0, ApplicationListModel.Favorites) - let item = launcherRepeater.itemAt(0); + let pos = Math.min(plasmoid.nativeInterface.applicationListModel.count, Math.floor(posInFavorites.x/favoriteStrip.cellWidth)) + plasmoid.nativeInterface.applicationListModel.addFavorite(storageId, pos, ApplicationListModel.Favorites) + let item = launcherRepeater.itemAt(pos); if (item) { item.x = posInFavorites.x; @@ -260,8 +267,9 @@ Item { } - plasmoid.nativeInterface.applicationListModel.addFavorite(storageId, 0, ApplicationListModel.Desktop) - let item = launcherRepeater.itemAt(0); + let pos = plasmoid.nativeInterface.applicationListModel.count; + plasmoid.nativeInterface.applicationListModel.addFavorite(storageId, pos, ApplicationListModel.Desktop) + let item = launcherRepeater.itemAt(pos); event.accept(event.proposedAction); if (item) {