diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-08-19 20:46:39 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-08-19 21:50:03 +0800 |
| commit | 68e1a276192872c57931e9e43911a479d4619c4a (patch) | |
| tree | 3cb7f752edc931971a429ead938eb1aa7e0af299 /launcher/components/IComponent.qml | |
| parent | a607f21ebaf6f7752626c1f568f90b36ec40c2c8 (diff) | |
chore(launcher -> popups): reorganize to allow futher expansion on popups
refactor(launcher): ILauncher is now a derivative of IPopup
Diffstat (limited to 'launcher/components/IComponent.qml')
| -rw-r--r-- | launcher/components/IComponent.qml | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/launcher/components/IComponent.qml b/launcher/components/IComponent.qml deleted file mode 100644 index 4f47b88..0000000 --- a/launcher/components/IComponent.qml +++ /dev/null @@ -1,93 +0,0 @@ -import Quickshell -import QtQuick - -import qs.components -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: 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: !standalone ? input && _input.startsWith(prefix) : true - property bool valid: !standalone ? processed?.valid || false : true - property bool priority: !standalone ? valid && processed?.priority || false : true // please set priority to false if it's invalid - property string answer: processed?.answer || "" - property Component preview: Component { - IText { - animate: true - text: answer - } - } - 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: active ? process() : {} // cached process, thought qml would do that automatically :/ - property var process: () => ({ - valid: valid, - priority: priority, - answer: answer, - preview: preview, - predictiveCompletion: predictiveCompletion - })// use the current IRect if valid is set - property var syncSelectionState: () => {} - // actions - property var up: () => ({ - top: false - }) - property var down: () => ({ - bottom: false - }) - property var prev: () => {} - property var next: () => {} - property var exec: () => {} - property var home: () => {} - property var end: () => {} - property var pgup: () => {} - property var pgdn: () => {} - - signal close - - function _exec() { - exec(); - close(); - } - - opacity: valid ? 1 : 0 - y: valid ? 0 : -Launcher.widgetHeight - - implicitWidth: valid ? Launcher.widgetWidth : 0 - implicitHeight: valid ? Launcher.widgetHeight : 0 - - // implicitWidth: Launcher.widgetWidth - // implicitHeight: Launcher.widgetHeight - - radius: Launcher.widgetRadius - color: Qt.rgba(Colors.background3.r, Colors.background3.g, Colors.background3.b, Launcher.widgetBgTransparency) // TODO when prioritized, highlight - - onPriorityChanged: { - // 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())]; - else - state.priorities = [root]; - }); - } - - Behavior on y { - NumberAnimation { - duration: General.animationDuration / 4 - easing.type: Easing.InOutQuad - } - } - - Component.onCompleted: { - Qt.callLater(() => { - syncSelectionState(); - }); - } -} |
