forked from len0rd/rockbox
time menu: stop scrolling before leave the screen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24583 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
aa8da2333e
commit
00d97d77e8
1 changed files with 9 additions and 15 deletions
|
|
@ -168,7 +168,7 @@ static void draw_timedate(struct viewport *vp, struct screen *display)
|
||||||
return;
|
return;
|
||||||
display->set_viewport(vp);
|
display->set_viewport(vp);
|
||||||
display->clear_viewport();
|
display->clear_viewport();
|
||||||
if (viewport_get_nb_lines(vp) > 3)
|
if (viewport_get_nb_lines(vp) >= 4)
|
||||||
line = 1;
|
line = 1;
|
||||||
else
|
else
|
||||||
line = 0;
|
line = 0;
|
||||||
|
|
@ -271,19 +271,11 @@ int time_screen(void* ignored)
|
||||||
clock[i].flags |= VP_FLAG_ALIGN_CENTER;
|
clock[i].flags |= VP_FLAG_ALIGN_CENTER;
|
||||||
|
|
||||||
font_h = font_get(clock[i].font)->height;
|
font_h = font_get(clock[i].font)->height;
|
||||||
if (nb_lines > 3)
|
nb_lines -= 2; /* at least 2 lines for menu */
|
||||||
{
|
if (nb_lines > 4)
|
||||||
if (nb_lines >= 5)
|
nb_lines = 4;
|
||||||
{
|
if (nb_lines >= 2)
|
||||||
clock[i].height = 3*font_h;
|
clock[i].height = nb_lines*font_h;
|
||||||
if (nb_lines > 5)
|
|
||||||
clock[i].height += font_h;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
clock[i].height = 2*font_h;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else /* disable the clock drawing */
|
else /* disable the clock drawing */
|
||||||
clock[i].height = 0;
|
clock[i].height = 0;
|
||||||
menu[i].y += clock[i].height;
|
menu[i].y += clock[i].height;
|
||||||
|
|
@ -292,9 +284,11 @@ int time_screen(void* ignored)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = do_menu(&time_menu, NULL, menu, false);
|
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 */
|
/* see comments above in the button callback */
|
||||||
if (!menu_was_pressed && ret == GO_TO_PREVIOUS)
|
if (!menu_was_pressed && ret == GO_TO_PREVIOUS)
|
||||||
return 0;
|
return 0;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue