summaryrefslogtreecommitdiff
path: root/launcher/components/IComponent.qml
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-08-11 19:16:05 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-08-14 15:37:02 +0800
commitb17ae550381232fd8c0cce5024e8ec0852918a33 (patch)
treecaad80336bcc1ff6c9a8f576cd7dfe3aa26db242 /launcher/components/IComponent.qml
parent6a910bb63463facb7c5b72c2054740154934c7a4 (diff)
feat(shell): implement standalone function for dynamic component loading
feat(Searchable): add Include algorithm and update filtering logic fix(Launcher): refactor state handling and improve selection logic fix(Clip): update clipHist property initialization and selection state sync refactor(IComponent): enhance state management and streamline properties refactor(Clip): change algorithm to Include for improved search functionality
Diffstat (limited to 'launcher/components/IComponent.qml')
-rw-r--r--launcher/components/IComponent.qml14
1 files changed, 10 insertions, 4 deletions
diff --git a/launcher/components/IComponent.qml b/launcher/components/IComponent.qml
index f0dc5f6..fdeb5b6 100644
--- a/launcher/components/IComponent.qml
+++ b/launcher/components/IComponent.qml
@@ -7,12 +7,14 @@ import qs.config
IRect {
id: root
// virtual properties
+ property bool standalone: false
+ property var state: SelectionState
property string name // Component/File name
- readonly property string _input: SelectionState.input
- readonly property string input: _input.slice(prefix.length)
+ readonly property string _input: state.input
+ readonly property string input: !standalone ? _input.slice(prefix.length) : _input
readonly property string inputCleaned: input.toLowerCase().trim()
property string prefix
- property bool active: input && _input.startsWith(prefix)
+ property bool active: !standalone ? input && _input.startsWith(prefix) : true
property bool valid: processed?.valid || false
property bool priority: valid && processed?.priority || false // please set priority to false if it's invalid
property string answer: processed?.answer || ""
@@ -66,7 +68,11 @@ IRect {
color: Qt.rgba(Colors.background3.r, Colors.background3.g, Colors.background3.b, Launcher.widgetBgTransparency) // TODO when prioritized, highlight
onPriorityChanged: {
- SelectionState.priorities = [...[...SelectionState.priorities, root].reduce((s, x) => (s[(s.has(x) && 'delete') || 'add'](x), s), new Set())]; // sync with SelectionState.priorities
+ // sync with state.priorities
+ if (!standalone)
+ state.priorities = [...[...state.priorities, root].reduce((s, x) => (s[(s.has(x) && 'delete') || 'add'](x), s), new Set())];
+ else
+ state.priorities = [this];
}
Behavior on y {