diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-08-19 21:19:45 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-08-19 21:50:03 +0800 |
| commit | 954366e70bea8f195b18356720c2914cfd1cfdac (patch) | |
| tree | 6d8003f4dea28cb24614c647c70a470493f971c6 /popups/launcher/components | |
| parent | 00364bf0ce9cf7ed55575c7ccf9cbd2acb35dbd3 (diff) | |
perf(launcher:Components): remove redundant calls to syncSelectionState
Diffstat (limited to 'popups/launcher/components')
| -rw-r--r-- | popups/launcher/components/Emoji.qml | 1 | ||||
| -rw-r--r-- | popups/launcher/components/Spell.qml | 19 |
2 files changed, 9 insertions, 11 deletions
diff --git a/popups/launcher/components/Emoji.qml b/popups/launcher/components/Emoji.qml index d4bc54f..4e3a58d 100644 --- a/popups/launcher/components/Emoji.qml +++ b/popups/launcher/components/Emoji.qml @@ -27,7 +27,6 @@ IComponent { return; } selectedIndex = emojis.length > 0 ? 0 : -1; - syncSelectionState(); if (loader.item && loader.item.flickable) loader.item.flickable.contentY = 0; }); diff --git a/popups/launcher/components/Spell.qml b/popups/launcher/components/Spell.qml index b081caa..cfe315f 100644 --- a/popups/launcher/components/Spell.qml +++ b/popups/launcher/components/Spell.qml @@ -27,16 +27,15 @@ IComponent { } onAspellChanged: { - if (selectedIndex !== -1) { - syncSelectionState(); - return; - } - selectedIndex = aspell.length > 0 ? 0 : -1; - // selectedIndexChanged dont get called somehow - syncSelectionState(); - if (loader.item && loader.item.flickable) { - loader.item.flickable.contentY = 0; - } + Qt.callLater(() => { + if (selectedIndex !== -1) { + syncSelectionState(); + return; + } + selectedIndex = aspell.length > 0 ? 0 : -1; + if (loader.item && loader.item.flickable) + loader.item.flickable.contentY = 0; + }); } onSelectedIndexChanged: { |
