summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2010-02-10 15:06:03 +0000
committerTeruaki Kawashima <teru@rockbox.org>2010-02-10 15:06:03 +0000
commit00d97d77e8ea55e2517443a50c37e28171afc3b3 (patch)
treefc2b3457578a18c46effe9be6a3db04f642c31c7
parentaa8da2333ea27fa077a0c1c8733f4fbc46048a0f (diff)
downloadrockbox-00d97d77e8ea55e2517443a50c37e28171afc3b3.tar.gz
rockbox-00d97d77e8ea55e2517443a50c37e28171afc3b3.tar.bz2
rockbox-00d97d77e8ea55e2517443a50c37e28171afc3b3.zip
time menu: stop scrolling before leave the screen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24583 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/menus/time_menu.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c
index 2b04275ac9..757ce82928 100644
--- a/apps/menus/time_menu.c
+++ b/apps/menus/time_menu.c
@@ -168,7 +168,7 @@ static void draw_timedate(struct viewport *vp, struct screen *display)
return;
display->set_viewport(vp);
display->clear_viewport();
- if (viewport_get_nb_lines(vp) > 3)
+ if (viewport_get_nb_lines(vp) >= 4)
line = 1;
else
line = 0;
@@ -271,19 +271,11 @@ int time_screen(void* ignored)
clock[i].flags |= VP_FLAG_ALIGN_CENTER;
font_h = font_get(clock[i].font)->height;
- if (nb_lines > 3)
- {
- if (nb_lines >= 5)
- {
- clock[i].height = 3*font_h;
- if (nb_lines > 5)
- clock[i].height += font_h;
- }
- else
- {
- clock[i].height = 2*font_h;
- }
- }
+ nb_lines -= 2; /* at least 2 lines for menu */
+ if (nb_lines > 4)
+ nb_lines = 4;
+ if (nb_lines >= 2)
+ clock[i].height = nb_lines*font_h;
else /* disable the clock drawing */
clock[i].height = 0;
menu[i].y += clock[i].height;
@@ -292,9 +284,11 @@ int time_screen(void* ignored)
}
ret = do_menu(&time_menu, NULL, menu, false);
+ FOR_NB_SCREENS(i)
+ screens[i].scroll_stop(&clock[i]);
+
/* see comments above in the button callback */
if (!menu_was_pressed && ret == GO_TO_PREVIOUS)
return 0;
return ret;
}
-