From b17ae550381232fd8c0cce5024e8ec0852918a33 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Mon, 11 Aug 2025 19:16:05 +0800 Subject: 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 --- launcher/components/IComponent.qml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'launcher/components/IComponent.qml') 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 { -- cgit v1.2.3