diff --git a/Modules/IPC/IPCManager.qml b/Modules/IPC/IPCManager.qml index e8d1e12..ebca4fa 100644 --- a/Modules/IPC/IPCManager.qml +++ b/Modules/IPC/IPCManager.qml @@ -37,45 +37,18 @@ Item { } } - IpcHandler { - target: "appLauncher" - function toggle() { - launcherPanel.toggle(Quickshell.screens[0]) - } - function clipboard() { - launcherPanel.toggle(Quickshell.screens[0]) - // Use the setSearchText function to set clipboard mode - Qt.callLater(() => { - launcherPanel.setSearchText(">clip ") - }) - } - function calculator() { - launcherPanel.toggle(Quickshell.screens[0]) - // Use the setSearchText function to set calculator mode - Qt.callLater(() => { - launcherPanel.setSearchText(">calc ") - }) - } - } - IpcHandler { target: "launcher" function toggle() { launcherPanel.toggle(Quickshell.screens[0]) } function clipboard() { + launcherPanel.setSearchText(">clip ") launcherPanel.toggle(Quickshell.screens[0]) - // Use the setSearchText function to set clipboard mode - Qt.callLater(() => { - launcherPanel.setSearchText(">clip ") - }) } function calculator() { + launcherPanel.setSearchText(">calc ") launcherPanel.toggle(Quickshell.screens[0]) - // Use the setSearchText function to set calculator mode - Qt.callLater(() => { - launcherPanel.setSearchText(">calc ") - }) } } diff --git a/Modules/Launcher/Launcher.qml b/Modules/Launcher/Launcher.qml index 6712c3d..27aa547 100644 --- a/Modules/Launcher/Launcher.qml +++ b/Modules/Launcher/Launcher.qml @@ -22,7 +22,6 @@ NPanel { return h } - panelKeyboardFocus: true panelBackgroundColor: Qt.rgba(Color.mSurface.r, Color.mSurface.g, Color.mSurface.b, Settings.data.appLauncher.backgroundOpacity) @@ -106,6 +105,9 @@ NPanel { } onClosed: { + // Reset search text + searchText = "" + // Notify plugins for (let plugin of plugins) { if (plugin.onClosed) @@ -172,7 +174,6 @@ NPanel { color: Color.transparent Component.onCompleted: { - searchText = "" selectedIndex = 0 if (searchInput?.forceActiveFocus) { searchInput.forceActiveFocus() @@ -295,7 +296,6 @@ NPanel { color: Color.mSurfaceVariant clip: true - // Image preview for clipboard images NImageRounded { id: imagePreview @@ -329,11 +329,11 @@ NPanel { // Error fallback onStatusChanged: status => { - if (status === Image.Error) { - iconLoader.visible = true - imagePreview.visible = false - } - } + if (status === Image.Error) { + iconLoader.visible = true + imagePreview.visible = false + } + } } // Icon fallback diff --git a/Modules/Launcher/Plugins/ClipboardPlugin.qml b/Modules/Launcher/Plugins/ClipboardPlugin.qml index 00cfb44..a196c13 100644 --- a/Modules/Launcher/Plugins/ClipboardPlugin.qml +++ b/Modules/Launcher/Plugins/ClipboardPlugin.qml @@ -49,9 +49,12 @@ Item { // Called when launcher opens function onOpened() { + isWaitingForData = true + gotResults = false + lastSearchText = "" + // Refresh clipboard history when launcher opens if (ClipboardService.active) { - isWaitingForData = true ClipboardService.list(100) } }