summaryrefslogtreecommitdiff
path: root/launcher/components/IComponent.qml
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-08-07 16:40:04 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-08-07 17:27:46 +0800
commitb0a018f4b6831d3289d8cb3604af2c9d9d12e4e8 (patch)
tree65f5f9933380b8513cd78f01cc1d0817134ce5ec /launcher/components/IComponent.qml
parentdd16e11c67411929e4167fe5d97f1810ad7012d6 (diff)
chore: standardize more Component functions
fix(Spell): not found if its correct
Diffstat (limited to 'launcher/components/IComponent.qml')
-rw-r--r--launcher/components/IComponent.qml6
1 files changed, 4 insertions, 2 deletions
diff --git a/launcher/components/IComponent.qml b/launcher/components/IComponent.qml
index 661dd67..f0dc5f6 100644
--- a/launcher/components/IComponent.qml
+++ b/launcher/components/IComponent.qml
@@ -8,9 +8,11 @@ IRect {
id: root
// virtual properties
property string name // Component/File name
- readonly property string input: SelectionState.input
+ readonly property string _input: SelectionState.input
+ readonly property string input: _input.slice(prefix.length)
readonly property string inputCleaned: input.toLowerCase().trim()
property string prefix
+ property bool active: input && _input.startsWith(prefix)
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 || ""
@@ -21,7 +23,7 @@ IRect {
}
}
property string predictiveCompletion: processed?.predictiveCompletion || "" // would technically work with just from answer, but stuff like calc's answer wouldnt have anything to do with the input
- property var processed: input && input.startsWith(prefix) ? process() : {} // cached process, thought qml would do that automatically :/
+ property var processed: active ? process() : {} // cached process, thought qml would do that automatically :/
property var process: () => ({
valid: valid,
priority: priority,