diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-08-18 01:06:16 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-08-19 20:15:21 +0800 |
| commit | e4fab905c3657c599574a2cabbf832a73a14e3da (patch) | |
| tree | f63d839cb3406b21189d17c6a5da5dbf8e87b60f /launcher/components/App.qml | |
| parent | 13f16c4aaa53aae232b61e6ba52e2851f8e685c7 (diff) | |
perf(launcher:Components): less checks syncSelectionState
Diffstat (limited to 'launcher/components/App.qml')
| -rw-r--r-- | launcher/components/App.qml | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/launcher/components/App.qml b/launcher/components/App.qml index 9955811..59a84cf 100644 --- a/launcher/components/App.qml +++ b/launcher/components/App.qml @@ -110,16 +110,7 @@ IComponent { } syncSelectionState: function () { - Qt.callLater(() => { - const item = listView.itemAtIndex(selectedIndex); - if (item) - state.selected = item; - else if (listView.count > 0) { - // wait until it's created - listView.forceLayout(); // forces creation if in view - Qt.callLater(syncSelectionState); - } - }); + Qt.callLater(() => state.selected = listView.itemAtIndex(selectedIndex)); } IInnerComponent { |
