diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-08-06 14:32:40 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-08-07 17:27:45 +0800 |
| commit | 97c2e2bf5a6e0a497e0a11cde6611c68f3767cd6 (patch) | |
| tree | 1e0dc8e2106f09232a74740cba2dab6c6dda0359 /launcher/components/SelectionState.qml | |
| parent | 2f857a56d14ec5937df5bf94f6d2775e47cbf817 (diff) | |
fix(launcher:selection): widget switching
Diffstat (limited to 'launcher/components/SelectionState.qml')
| -rw-r--r-- | launcher/components/SelectionState.qml | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/launcher/components/SelectionState.qml b/launcher/components/SelectionState.qml index 2e53155..6df7116 100644 --- a/launcher/components/SelectionState.qml +++ b/launcher/components/SelectionState.qml @@ -8,8 +8,18 @@ Singleton { property int cursorPosition: 0 property var priorities: [] property int selectedPriority: 0 + property int previousSelectedPriority: 0 property var widgets: [] + onSelectedPriorityChanged: { + if (selectedPriority > previousSelectedPriority) + priorities[selectedPriority].home(); + else + priorities[selectedPriority].end(); + + previousSelectedPriority = selectedPriority; + } + // order them based on widgets(which came from order from config) onPrioritiesChanged: { for (let i = priorities.length - 1; i >= 0; i--) |
