applets/systemtray: reset currentIndex when searching
Original commit message(s)
- applets/systemtray: reset currentIndex when searching
Reason for the change
The header in the system tray config dialog is in the same FocusScope as the ListView itself. If there is a currentItem, Qt will try to maintain the same item as the currentItem, which gives it focus in its FocusScope so the search field will lose focus after every key press; otherwise it may set it to the first item, with the same result.
Instead, clear the currentIndex before searching - this way, focus will stick on the search field until the user presses Down arrow to intentionally interact with the results. Maintaing the currentItem on search does not seem necessary; if the user already has selected the item they want to interact with, they don't need to search for it anymore, so if they're editing the search it's reasonable to assume they don't care about whatever happened to be selected last.
Test plan
- Open system tray config
- Try to search (delete characters if it doesn't trigger immediately, not every query immediately sets the currentIndex, but once it's set it triggers consistently)
Screenshots or screen recordings
N/A
Bugs fixed
BUG: 515863 FIXED-IN: 6.6.1