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
This commit is contained in:
Marco Martin 2021-03-04 12:35:58 +01:00
parent b81d29d2c2
commit 5814fd9696

View file

@ -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) {