summaryrefslogtreecommitdiff
path: root/launcher/components
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-08-19 18:57:48 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-08-19 20:50:46 +0800
commita607f21ebaf6f7752626c1f568f90b36ec40c2c8 (patch)
tree2b33d93aed3b28fa26a8dbda8a41c7bc7d6a9ac3 /launcher/components
parent7419b49dbd9495f40f09d43bb26115a788d455d6 (diff)
feat(launcher): persist state between reloads
Diffstat (limited to 'launcher/components')
-rw-r--r--launcher/components/SelectionState.qml21
1 files changed, 16 insertions, 5 deletions
diff --git a/launcher/components/SelectionState.qml b/launcher/components/SelectionState.qml
index 20d7fdf..1ab577a 100644
--- a/launcher/components/SelectionState.qml
+++ b/launcher/components/SelectionState.qml
@@ -3,12 +3,24 @@ import Quickshell
import QtQuick
Singleton {
+ id: root
+
+ PersistentProperties {
+ id: persist
+ reloadableId: "launcherSelectionState"
+
+ property string input: ""
+ property int cursorPosition: 0
+ property int selectedPriority: 0
+ property int previousSelectedPriority: 0
+ }
+
property Item selected: null
- property string input: ""
- property int cursorPosition: 0
+ property alias input: persist.input
+ property alias cursorPosition: persist.cursorPosition
property var priorities: []
- property int selectedPriority: 0
- property int previousSelectedPriority: 0
+ property alias selectedPriority: persist.selectedPriority
+ property alias previousSelectedPriority: persist.previousSelectedPriority
property var widgets: []
onSelectedPriorityChanged: {
@@ -22,7 +34,6 @@ Singleton {
previousSelectedPriority = selectedPriority;
}
-
// order them based on widgets(which came from order from config)
onPrioritiesChanged: {
for (let i = priorities.length - 1; i >= 0; i--)