diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-08-18 01:08:33 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-08-19 20:15:21 +0800 |
| commit | f91daeb5787cc8e433ed50b24b2489bfd9b26857 (patch) | |
| tree | 9642aca2afec3aa1ccaa33a00e5207ad5ae9bdf3 | |
| parent | e4fab905c3657c599574a2cabbf832a73a14e3da (diff) | |
ux(launcher:Components): preserve selected position
| -rw-r--r-- | launcher/components/App.qml | 4 | ||||
| -rw-r--r-- | launcher/components/Clip.qml | 4 | ||||
| -rw-r--r-- | launcher/components/Emoji.qml | 4 | ||||
| -rw-r--r-- | launcher/components/Spell.qml | 4 |
4 files changed, 16 insertions, 0 deletions
diff --git a/launcher/components/App.qml b/launcher/components/App.qml index 59a84cf..616cccc 100644 --- a/launcher/components/App.qml +++ b/launcher/components/App.qml @@ -95,6 +95,10 @@ IComponent { } onEntriesChanged: { + if (selectedIndex !== -1) { + syncSelectionState(); + return; + } selectedIndex = 0; listView.contentY = 0; syncSelectionState(); diff --git a/launcher/components/Clip.qml b/launcher/components/Clip.qml index 297a3d4..b1b7d88 100644 --- a/launcher/components/Clip.qml +++ b/launcher/components/Clip.qml @@ -46,6 +46,10 @@ IComponent { } onClipHistChanged: { + if (selectedIndex !== -1) { + syncSelectionState(); + return; + } mouseTriggered = false; selectedIndex = 0; listView.positionViewAtBeginning(); diff --git a/launcher/components/Emoji.qml b/launcher/components/Emoji.qml index 551b647..d4bc54f 100644 --- a/launcher/components/Emoji.qml +++ b/launcher/components/Emoji.qml @@ -22,6 +22,10 @@ IComponent { onEmojisChanged: { Qt.callLater(() => { + if (selectedIndex !== -1) { + syncSelectionState(); + return; + } selectedIndex = emojis.length > 0 ? 0 : -1; syncSelectionState(); if (loader.item && loader.item.flickable) diff --git a/launcher/components/Spell.qml b/launcher/components/Spell.qml index d04e0eb..2072057 100644 --- a/launcher/components/Spell.qml +++ b/launcher/components/Spell.qml @@ -27,6 +27,10 @@ IComponent { } onAspellChanged: { + if (selectedIndex !== -1) { + syncSelectionState(); + return; + } selectedIndex = aspell.length > 0 ? 0 : -1; // selectedIndexChanged dont get called somehow syncSelectionState(); |
