Add custom page up/down keyboard selection in song select#36305
Add custom page up/down keyboard selection in song select#36305AndyBodnar wants to merge 2 commits intoppy:masterfrom
Conversation
Instead of using the standard scroll container page up/down behavior (which just scrolls the view), this implements keyboard selection-based page navigation like in osu! stable. Pressing Page Up or Page Down now moves the keyboard selection by multiple items (currently 5) rather than simply scrolling the viewport.
Change `newIndex = newIndex - direction` to `newIndex -= direction`
|
Duplicate of #36293. Only one of these two should be merged. |
|
@peppy Thanks for flagging #36293 - I hadn't seen it when I started working on this. A few differences in my implementation that might be worth considering: Tests - This PR includes Configurability - Added a Lines: +292 (vs +85) - the extra is mostly test coverage That said, I'm happy to go whichever direction works best for the project. If you'd prefer to move forward with #36293, I can close this - just point me in the direction you want. Alternatively, I could contribute my tests to their PR if that's useful. |
|
Closing this one since #36293 covers the same feature. Makes more sense to focus efforts on a single PR rather than splitting review attention. If the other PR needs any help with tests or anything else, happy to contribute there. |
This implements custom page up/down handling in song select like peppy mentioned in the issue. Instead of using the standard scroll container behavior which just scrolls the view by a page, it now changes the keyboard selection by multiple items at once.
The page navigation moves the selection by 5 visible items at a time (this is configurable via the
PageSelectionDistanceproperty if we want to tweak it later). The implementation doesn't wrap around at the ends of the list, so pressing Page Down at the bottom just stays at the bottom rather than jumping back to the start.I've also added some basic tests to verify the page navigation moves the selection by more than one item and doesn't wrap around.
Closes #36099