From 78ad386209aaf20a7e122f11791e54fdcddb958b Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 22 Aug 2026 17:01:08 +0800 Subject: IComponent: default keyboard shortcut up/down to switch bump: fmt --- config/Launcher.qml | 12 ++++++------ popups/launcher/components/IComponent.qml | 17 +++++++++-------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/config/Launcher.qml b/config/Launcher.qml index 3d8c607..d93b8a7 100644 --- a/config/Launcher.qml +++ b/config/Launcher.qml @@ -35,10 +35,10 @@ Singleton { readonly property int duckduckgoSpacing: 25 readonly property list widgets: [ - // recommanded order: - // 1. components with .startswith - // 2. utils - // 3. app launcher + // recommanded order: + // 1. components with .startswith + // 2. utils + // 3. app launcher Component { Emoji {} }, @@ -58,13 +58,13 @@ Singleton { Unit {} }, Component { - Currency {} + Currency {} }, Component { App {} }, Component { - DuckDuckGo {} + DuckDuckGo {} } ] } diff --git a/popups/launcher/components/IComponent.qml b/popups/launcher/components/IComponent.qml index b59425a..7450ffd 100644 --- a/popups/launcher/components/IComponent.qml +++ b/popups/launcher/components/IComponent.qml @@ -20,9 +20,9 @@ IRect { property string answer: processed?.answer || "" property Component preview: Component { IText { - // TODO: use proper active: false via Loader - visible: answer.length <= Launcher.maxPreviewLen - animate: true + // TODO: use proper active: false via Loader + visible: answer.length <= Launcher.maxPreviewLen + animate: true text: answer } } @@ -34,14 +34,15 @@ IRect { answer: answer, preview: preview, predictiveCompletion: predictiveCompletion - })// use the current IRect if valid is set + }) + // use the current IRect if valid is set property var syncSelectionState: () => {} // actions property var up: () => ({ - top: false + top: true }) property var down: () => ({ - bottom: false + bottom: true }) property var prev: () => {} property var next: () => {} @@ -56,7 +57,7 @@ IRect { function _exec() { if (!exec()) - close(); + close(); } // this doesn't change launcher size but only hides the actual content but the outside still think the content is there @@ -77,7 +78,7 @@ IRect { // sync with state.priorities Qt.callLater(() => { if (!standalone) - state.priorities = [...[...state.priorities, root].reduce((s, x) => (s[(s.has(x) && 'delete') || 'add'](x), s), new Set())]; + state.priorities = state.priorities.includes(root) ? state.priorities.filter(x => x !== root) : [...new Set(state.priorities), root]; else state.priorities = [root]; }); -- cgit v1.2.3