-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap selection around at the bottom/top of the library's tracks list #11090
Wrap selection around at the bottom/top of the library's tracks list #11090
Conversation
This makes navigating key-sorted track lists using a controller much more convenient. Though as mentioned in the comment, this does not match the Up/Down cursor key behavior. Should those also wrap around?
Since it made a lot of sense to me both consistency and functionality wise to also use this same behavior for Up/Down cursor key presses, I ended up changing the implementation to instead add the wraparound directly to the cursor movement handler in the library Let me know what you think. |
565c8bc
to
fbee730
Compare
This matches the new(ly restored) behavior from dc83783 by overriding `QTableView`'s `moveCursor()` function. This way this also works as expected with the other common selection hotkeys like Shift+Up/Down and Ctrl+Up/Down -> Space.
The event handler for `WLibraryTableView` now also wraps around the list when navigating it using the cursor keys. So `[Library],MoveVertical` can revert to just sending Up/Down key events to the `WLibraryTableView`.
This happens when the view has not yet been interacted with.
fbee730
to
11f5f89
Compare
Thank you, this looks good. Overriding |
Btw, I wondered why we actually have WTrackTableView and WLibraryTableView, so I moved |
Yeah sure! So you're referring to the Shift/Ctrl handling, right? I took a peek at how this works in |
Yes, that's what I mean.
|
I'll take a look at that tomorrow. Want me to tack it onto this PR or should I create a second one? |
I think a separate PR is better because this one can be merged as soon as we did some testing, and agreed to make wrapping around the default. Actually it depends on where you want to implement Home/End modifiers. If you do it in moveCursor() you may have to rebase this PR since the new will probably get merged quicker, it's a small improvement = doesn't break anything. |
@mixxxdj/developers Does anyone have objections making Up/Down keys wrap around? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No Objections.
The code looks good and the cursor behaves natural when using Keyboard.
Thank you very much.
@daschuer Any thoughts on that? Continued in #11100 (comment) |
I'm torn apart regarding this feature:
That is due to the default scroll behaviour: the selection needs to reach the top/bottom of the viewport before it'd scroll the view. Possible fixes:
What do you think? |
Always keeping 1-3 lines of context when scrolling is a good idea regardless. And I do still think wraparound without pauses or anything is a necessary feature. If you're scrolling through the list with the cursor keys then you may as well use a mouse which is faster. But if you're using a controller to navigate you won't have the equivalent of a home/end key to bring you to the start/end of the list. Wraparound is the only logical behavior as I see it. |
I'm using a controller and I still prefer to hit Home when I'm midway in the tracks. Do you have pointers how to get more context when scrolling? |
I've never used Qt so I'd also need to dig through the APIs first. I doubt something like this would already exist within Qt, but the idea would be that whenever the selection/focus changes the view would be scrolled as necessary to make sure the 2-3 items above and below the focused item are visible. With some extra behavior to reduce this number as the widget's height decreases and fewer items fit (so if only three rows fit it would try to keep one above and one below the selected row visible). |
well, for the time being, this is my personal workaround: |
As described in #11088. This makes navigating key-sorted track lists using a controller much more convenient.
Though as mentioned in the comment, this does not match the Up/Down cursor key behavior. Should that maybe also cause the tracks list to wrap around? On a keyboard you have Home/End to go to the start and end of the list, but there I'd also expect the cursor keys there to wrap the list around in a similar way.See below.