Fix Pin to Dock not reappearing after unpin

The visible binding on the Pin to Dock menu item called the
imperative containsApplication() without any reactive dependency,
so QML never re-evaluated it after model changes. Add repeater.count
to the binding to force re-evaluation when favourites change.
This commit is contained in:
Marco Allegretti 2026-04-12 09:36:23 +02:00
parent 1ce85bba28
commit 03ba3bc616

View file

@ -747,7 +747,8 @@ MouseArea {
PC3.MenuItem {
icon.name: "window-pin"
text: i18n("Pin to Dock")
visible: taskContextMenu.taskStorageId !== "" && !folio.FavouritesModel.containsApplication(taskContextMenu.taskStorageId)
// repeater.count dependency forces re-evaluation when favourites change
visible: taskContextMenu.taskStorageId !== "" && repeater.count >= 0 && !folio.FavouritesModel.containsApplication(taskContextMenu.taskStorageId)
enabled: !folio.FolioSettings.lockLayout
onClicked: folio.FavouritesModel.addApplication(taskContextMenu.taskStorageId)
}