From dc83783669ce45392f1955825e129d299ed8190c Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 23 Nov 2022 17:28:21 +0100 Subject: [PATCH] Restore wraparound in [Library],MoveVertical 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? --- src/library/librarycontrol.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/library/librarycontrol.cpp b/src/library/librarycontrol.cpp index 264a2b25bfc..6d833d23520 100644 --- a/src/library/librarycontrol.cpp +++ b/src/library/librarycontrol.cpp @@ -635,12 +635,14 @@ void LibraryControl::slotMoveVertical(double v) { return; } case FocusWidget::TracksTable: { - // This wraps around at top/bottom. Doesn't match Up/Down key behaviour - // and may not be desired. - //int i = static_cast(v); - //slotSelectTrack(i); - //return; - break; + // 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(v); + slotSelectTrack(i); + return; } case FocusWidget::Dialog: { // For navigating dialogs map up/down to Tab/BackTab