1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-02 18:05:26 +03: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:
Maarten ter Huurne 2013-08-12 06:11:18 +02:00
parent 6cdd5694d3
commit f820bf8d6e

View File

@ -651,10 +651,11 @@ void Menu::setLinkIndex(int i) {
iLink = i; iLink = i;
int row = i / linkColumns; int row = i / linkColumns;
if (row >= (int)(iFirstDispRow + linkRows)) if (row >= (int)(iFirstDispRow + linkRows - 1))
iFirstDispRow = row - linkRows + 1; iFirstDispRow = min(row + 1, (int)DIV_ROUND_UP(numLinks, linkColumns) - 1)
else if (row < (int)iFirstDispRow) - linkRows + 1;
iFirstDispRow = row; else if (row <= (int)iFirstDispRow)
iFirstDispRow = max(row - 1, 0);
} }
#ifdef HAVE_LIBOPK #ifdef HAVE_LIBOPK