summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2026-08-22 17:01:08 +0800
committerlittleblack111 <littleblack11111@gmail.com>2026-08-22 17:01:35 +0800
commit78ad386209aaf20a7e122f11791e54fdcddb958b (patch)
tree4d0c34e5dacc5915ae0319fbd304b3e3a258700d
parentfc96d37c1440e5386181cde4e904459bb544d66d (diff)
IComponent: default keyboard shortcut up/down to switch
bump: fmt
-rw-r--r--config/Launcher.qml12
-rw-r--r--popups/launcher/components/IComponent.qml17
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<Component> 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];
});