Skip to content

Commit

Permalink
Reuse new cursor key handler in MoveVertical
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
robbert-vdh committed Nov 23, 2022
1 parent 0f49389 commit 565c8bc
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/library/librarycontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,14 +635,12 @@ void LibraryControl::slotMoveVertical(double v) {
return;
}
case FocusWidget::TracksTable: {
// This wraps around at the top/bottom of the tracks list. Doesn't match
// Up/Down key behaviour, but it greatly improves the ergonomics of
// navigating a list of tracks sorted by key from a controller.
// Otherwise moving from 12/C#m/E to 1/G#m/B requires either a serious
// workout or reaching for the mouse/keyboard.
const auto i = static_cast<int>(v);
slotSelectTrack(i);
return;
// `WLibraryTableView`'s cursor movement function has been overridden to
// wrap the selection around at the top/bottom of the tracks list. This
// behavior is thus shared between `[Library],MoveVertical` and Up/Down
// cursor key presses. See `WLibraryTableView::moveCursor()` for an
// explanation on why this is useful.
break;
}
case FocusWidget::Dialog: {
// For navigating dialogs map up/down to Tab/BackTab
Expand Down

0 comments on commit 565c8bc

Please sign in to comment.