summaryrefslogtreecommitdiff
path: root/osdbase.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-06-17 15:47:27 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-06-17 15:47:27 +0200
commitf1ccf3712859336561b9f7aeb7162dc97a5088cd (patch)
tree4d9642c576ecdc7a0d5df34b673247cecb849f83 /osdbase.c
parent80a7ef5a55eb5e594af018077630c5aa892ccc19 (diff)
downloadvdr-f1ccf3712859336561b9f7aeb7162dc97a5088cd.tar.gz
vdr-f1ccf3712859336561b9f7aeb7162dc97a5088cd.tar.bz2
Modified page scrolling behaviour
Diffstat (limited to 'osdbase.c')
-rw-r--r--osdbase.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/osdbase.c b/osdbase.c
index b27b1df2..711bd4cd 100644
--- a/osdbase.c
+++ b/osdbase.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osdbase.c 1.18 2005/06/17 14:22:34 kls Exp $
+ * $Id: osdbase.c 1.19 2005/06/17 15:35:27 kls Exp $
*/
#include "osdbase.h"
@@ -271,9 +271,7 @@ void cOsdMenu::CursorUp(void)
DisplayCurrent(false);
current = tmpCurrent;
if (current < first) {
- first = first > displayMenuItems - 1 ? first - (displayMenuItems - 1) : 0;
- if (Setup.MenuScrollPage)
- current = !SelectableItem(first) ? first + 1 : first;
+ first = Setup.MenuScrollPage ? max(0, current - displayMenuItems + 1) : current;
Display();
}
else
@@ -284,9 +282,8 @@ void cOsdMenu::CursorUp(void)
void cOsdMenu::CursorDown(void)
{
int last = Count() - 1;
- int lastOnScreen = first + displayMenuItems - 1;
-
if (current < last) {
+ int lastOnScreen = first + displayMenuItems - 1;
int tmpCurrent = current;
while (++tmpCurrent <= last && !SelectableItem(tmpCurrent))
;
@@ -296,14 +293,9 @@ void cOsdMenu::CursorDown(void)
DisplayCurrent(false);
current = tmpCurrent;
if (current > lastOnScreen) {
- first += displayMenuItems - 1;
- lastOnScreen = first + displayMenuItems - 1;
- if (lastOnScreen > last) {
- first = last - (displayMenuItems - 1);
- lastOnScreen = last;
- }
- if (Setup.MenuScrollPage)
- current = !SelectableItem(lastOnScreen) ? lastOnScreen - 1 : lastOnScreen;
+ first = Setup.MenuScrollPage ? current : max(0, current - displayMenuItems + 1);
+ if (first + displayMenuItems > last)
+ first = max(0, last - displayMenuItems + 1);
Display();
}
else