feat(thumbnail grid): arrow key navigation & selection history #1220
feat(thumbnail grid): arrow key navigation & selection history #1220louisl4696 wants to merge 4 commits intoTagStudioDev:mainfrom
Conversation
- Added arrow key navigation for thumbnail grid TagStudioDev#226 - Implemented selection history with undo/redo TagStudioDev#1215
|
I've noticed that occasionally, the scrollbar will suddenly jump to a different position (often the bottom) seemingly randomly while navigating with arrow keys. |
|
Some other issues I've noticed:
|
This seems to start happening after interacting with an entry's tags. |
Fix errors + use match for key input instead of elif chain
|
I'm back, but busier than ever :') Yeah, I noticed the behaviours you mentioned too after using it for some time. Concerning the autocomplete, that's an oversight on my end... I actually didn't know that feature existed x) For the scrolling, my best guess is that it has something to do with selecting an entry that's outside of the visible range, something that isn't possible to do with just the mouse... It seems to me that modifying tags is (sometimes) causing the inputs to be counted twice, but why that is I don't know yet |
Summary
Arrow key navigation
Arrow keys events in MainWindow are intercepted by an eventFilter and trigger callbacks in ThumbGridLayout. Shift key events are also intercepted but do not block the event from continuing down Qt's event pipeline. Arrow key navigation mimics the behaviour of windows file explorer as outlined in #226, including multi-selection.
closes #226
Selection history
The last 30 (number chosen arbitrarily) selections are stored in a deque. Hitting R pops the most recent selection from the deque, and pushes the current selection to a second deque for redo-ing. Hitting Shift+R pops from the redo deque. It's very satisfying to use (I may be biased)
This feature could later be included into a higher level history, see #1215 for the full discussion !
Selection state changes are saved in the deques via a decorator for methods that modify the selection.
Because that includes the methods used for arrow key navigation, I wasn't able to cleanly separate these two features into two PRs... Sorry 😅
Tasks Completed