diff options
author | Teruaki Kawashima <teru@rockbox.org> | 2010-02-10 15:06:03 +0000 |
---|---|---|
committer | Teruaki Kawashima <teru@rockbox.org> | 2010-02-10 15:06:03 +0000 |
commit | 00d97d77e8ea55e2517443a50c37e28171afc3b3 (patch) | |
tree | fc2b3457578a18c46effe9be6a3db04f642c31c7 /apps | |
parent | aa8da2333ea27fa077a0c1c8733f4fbc46048a0f (diff) | |
download | rockbox-00d97d77e8ea55e2517443a50c37e28171afc3b3.tar.gz 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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/menus/time_menu.c | 24 |
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) | |||
168 | return; | 168 | return; |
169 | display->set_viewport(vp); | 169 | display->set_viewport(vp); |
170 | display->clear_viewport(); | 170 | display->clear_viewport(); |
171 | if (viewport_get_nb_lines(vp) > 3) | 171 | if (viewport_get_nb_lines(vp) >= 4) |
172 | line = 1; | 172 | line = 1; |
173 | else | 173 | else |
174 | line = 0; | 174 | line = 0; |
@@ -271,19 +271,11 @@ int time_screen(void* ignored) | |||
271 | clock[i].flags |= VP_FLAG_ALIGN_CENTER; | 271 | clock[i].flags |= VP_FLAG_ALIGN_CENTER; |
272 | 272 | ||
273 | font_h = font_get(clock[i].font)->height; | 273 | font_h = font_get(clock[i].font)->height; |
274 | if (nb_lines > 3) | 274 | nb_lines -= 2; /* at least 2 lines for menu */ |
275 | { | 275 | if (nb_lines > 4) |
276 | if (nb_lines >= 5) | 276 | nb_lines = 4; |
277 | { | 277 | if (nb_lines >= 2) |
278 | clock[i].height = 3*font_h; | 278 | clock[i].height = nb_lines*font_h; |
279 | if (nb_lines > 5) | ||
280 | clock[i].height += font_h; | ||
281 | } | ||
282 | else | ||
283 | { | ||
284 | clock[i].height = 2*font_h; | ||
285 | } | ||
286 | } | ||
287 | else /* disable the clock drawing */ | 279 | else /* disable the clock drawing */ |
288 | clock[i].height = 0; | 280 | clock[i].height = 0; |
289 | menu[i].y += clock[i].height; | 281 | menu[i].y += clock[i].height; |
@@ -292,9 +284,11 @@ int time_screen(void* ignored) | |||
292 | } | 284 | } |
293 | 285 | ||
294 | ret = do_menu(&time_menu, NULL, menu, false); | 286 | ret = do_menu(&time_menu, NULL, menu, false); |
287 | FOR_NB_SCREENS(i) | ||
288 | screens[i].scroll_stop(&clock[i]); | ||
289 | |||
295 | /* see comments above in the button callback */ | 290 | /* see comments above in the button callback */ |
296 | if (!menu_was_pressed && ret == GO_TO_PREVIOUS) | 291 | if (!menu_was_pressed && ret == GO_TO_PREVIOUS) |
297 | return 0; | 292 | return 0; |
298 | return ret; | 293 | return ret; |
299 | } | 294 | } |
300 | |||