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:
Maarten ter Huurne
2013-08-12 06:11:18 +02:00
parent 6cdd5694d3
commit f820bf8d6e
+5 -4
View File
@@ -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