mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 12:30:18 +02:00
Scroll when link cursor moves into top/bottom row
Previously, the links would scroll when the cursor was about to move out of screen. By scrolling earlier, the user gets a view of the next row before it becomes the current row. This allows a longer reaction time to switch from vertical to horizontal navigation when looking for a particular link in the grid.
This commit is contained in:
parent
6cdd5694d3
commit
f820bf8d6e
@ -651,10 +651,11 @@ void Menu::setLinkIndex(int i) {
|
||||
iLink = i;
|
||||
|
||||
int row = i / linkColumns;
|
||||
if (row >= (int)(iFirstDispRow + linkRows))
|
||||
iFirstDispRow = row - linkRows + 1;
|
||||
else if (row < (int)iFirstDispRow)
|
||||
iFirstDispRow = row;
|
||||
if (row >= (int)(iFirstDispRow + linkRows - 1))
|
||||
iFirstDispRow = min(row + 1, (int)DIV_ROUND_UP(numLinks, linkColumns) - 1)
|
||||
- linkRows + 1;
|
||||
else if (row <= (int)iFirstDispRow)
|
||||
iFirstDispRow = max(row - 1, 0);
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBOPK
|
||||
|
Loading…
Reference in New Issue
Block a user