From 1a7ab224caa1e93151b60ec1276801f4e7ce6645 Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Sun, 30 Nov 2025 13:44:51 +0100 Subject: [PATCH] Launcher: add pin button to grid view --- Modules/Panels/Launcher/Launcher.qml | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Modules/Panels/Launcher/Launcher.qml b/Modules/Panels/Launcher/Launcher.qml index 98fb56bb..d55a5808 100644 --- a/Modules/Panels/Launcher/Launcher.qml +++ b/Modules/Panels/Launcher/Launcher.qml @@ -996,6 +996,24 @@ SmartPanel { property bool isSelected: (!root.ignoreMouseHover && mouseArea.containsMouse) || (index === selectedIndex) property string appId: (modelData && modelData.appId) ? String(modelData.appId) : "" + // Pin helpers + function togglePin(appId) { + if (!appId) + return; + let arr = (Settings.data.dock.pinnedApps || []).slice(); + const idx = arr.indexOf(appId); + if (idx >= 0) + arr.splice(idx, 1); + else + arr.push(appId); + Settings.data.dock.pinnedApps = arr; + } + + function isPinned(appId) { + const arr = Settings.data.dock.pinnedApps || []; + return appId && arr.indexOf(appId) >= 0; + } + width: { if (root.activePlugin === emojiPlugin && emojiPlugin.isBrowsingMode) { return resultsGrid.width / 5; @@ -1139,6 +1157,18 @@ SmartPanel { } } + // Pin/Unpin action icon button (overlay in top-right corner) + NIconButton { + visible: !!gridEntry.appId && !modelData.isImage && gridEntry.isSelected && Settings.data.dock.enabled + anchors.top: parent.top + anchors.right: parent.right + anchors.margins: Style.marginXS + z: 10 + icon: gridEntry.isPinned(gridEntry.appId) ? "unpin" : "pin" + tooltipText: gridEntry.isPinned(gridEntry.appId) ? I18n.tr("launcher.unpin") : I18n.tr("launcher.pin") + onClicked: gridEntry.togglePin(gridEntry.appId) + } + MouseArea { id: mouseArea anchors.fill: parent