From ad96d2b05cd2420a082a35019b9d65d0858c6b18 Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Sun, 23 Nov 2025 22:05:40 +0100 Subject: [PATCH] Launcher: force calculator to listview ClipboardService: fix warning IPCService: add launcher emoji ipc --- Modules/Panels/Launcher/Launcher.qml | 19 +++++++++++++------ Services/Control/IPCService.qml | 7 +++++++ Services/Keyboard/ClipboardService.qml | 1 + 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Modules/Panels/Launcher/Launcher.qml b/Modules/Panels/Launcher/Launcher.qml index e1cc31ed..e8dfdcda 100644 --- a/Modules/Panels/Launcher/Launcher.qml +++ b/Modules/Panels/Launcher/Launcher.qml @@ -56,8 +56,8 @@ SmartPanel { readonly property int badgeSize: Math.round(Style.baseWidgetSize * 1.6) readonly property int entryHeight: Math.round(badgeSize + Style.marginM * 2) readonly property bool isGridView: { - // Always use list view for clipboard to better display text content and previews - if (searchText.startsWith(">clip")) { + // Always use list view for clipboard and calculator to better display content + if (searchText.startsWith(">clip") || searchText.startsWith(">calc")) { return false; } return Settings.data.appLauncher.viewMode === "grid"; @@ -876,13 +876,20 @@ SmartPanel { // Handle scrolling to show selected item when it changes Connections { target: root + enabled: root.isGridView function onSelectedIndexChanged() { - if (root.selectedIndex >= 0) { - Qt.callLater(() => { + // Only process if we're still in grid view and component exists + if (!root.isGridView || root.selectedIndex < 0 || !resultsGrid) { + return; + } + + Qt.callLater(() => { + // Double-check we're still in grid view mode + if (root.isGridView && resultsGrid && resultsGrid.cancelFlick) { resultsGrid.cancelFlick(); resultsGrid.positionViewAtIndex(root.selectedIndex, GridView.Contain); - }); - } + } + }); // Update preview if (clipboardPreviewLoader.item && root.selectedIndex >= 0) { diff --git a/Services/Control/IPCService.qml b/Services/Control/IPCService.qml index 62a97a3a..ed1641da 100644 --- a/Services/Control/IPCService.qml +++ b/Services/Control/IPCService.qml @@ -112,6 +112,13 @@ Item { launcherPanel?.toggle(); }); } + function emoji() { + root.withTargetScreen(screen => { + var launcherPanel = PanelService.getPanel("launcherPanel", screen); + launcherPanel?.setSearchText(">emoji "); + launcherPanel?.toggle(); + }); + } } IpcHandler { diff --git a/Services/Keyboard/ClipboardService.qml b/Services/Keyboard/ClipboardService.qml index b54fb260..b77fe5cf 100644 --- a/Services/Keyboard/ClipboardService.qml +++ b/Services/Keyboard/ClipboardService.qml @@ -4,6 +4,7 @@ import QtQuick import Quickshell import Quickshell.Io import qs.Commons +import qs.Services.UI // Thin wrapper around the cliphist CLI Singleton {