diff options
author | Teruaki Kawashima <teru@rockbox.org> | 2009-08-20 13:36:19 +0000 |
---|---|---|
committer | Teruaki Kawashima <teru@rockbox.org> | 2009-08-20 13:36:19 +0000 |
commit | b944901354a2e7d7f149e36b872c931c1a2529fe (patch) | |
tree | 457ae0ff2820f34dae29e041ec9c0ad6a7864cf9 | |
parent | 5b349e3cfab837e56f59b441bb1694956b76df81 (diff) | |
download | rockbox-b944901354a2e7d7f149e36b872c931c1a2529fe.tar.gz rockbox-b944901354a2e7d7f149e36b872c931c1a2529fe.zip |
Change height calculation of viewport for time and date menu so that it doesn't break statusbar.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22437 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/menus/time_menu.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c index 6d5370473e..457187cf41 100644 --- a/apps/menus/time_menu.c +++ b/apps/menus/time_menu.c | |||
@@ -173,7 +173,7 @@ static void draw_timedate(struct viewport *vp, struct screen *display) | |||
173 | line = 1; | 173 | line = 1; |
174 | else | 174 | else |
175 | line = 0; | 175 | line = 0; |
176 | 176 | ||
177 | if (valid_time(tm)) | 177 | if (valid_time(tm)) |
178 | { | 178 | { |
179 | snprintf(time, 16, "%02d:%02d:%02d%s", | 179 | snprintf(time, 16, "%02d:%02d:%02d%s", |
@@ -199,7 +199,7 @@ static void draw_timedate(struct viewport *vp, struct screen *display) | |||
199 | else | 199 | else |
200 | display->putsxy((vp->width - w)/2, line*font_get(vp->font)->height, time); | 200 | display->putsxy((vp->width - w)/2, line*font_get(vp->font)->height, time); |
201 | line++; | 201 | line++; |
202 | 202 | ||
203 | display->getstringsize(date, &w, NULL); | 203 | display->getstringsize(date, &w, NULL); |
204 | if (w > vp->width) | 204 | if (w > vp->width) |
205 | display->puts_scroll(0, line, date); | 205 | display->puts_scroll(0, line, date); |
@@ -217,7 +217,7 @@ static int time_menu_callback(int action, | |||
217 | int i; | 217 | int i; |
218 | static int last_redraw = 0; | 218 | static int last_redraw = 0; |
219 | bool redraw = false; | 219 | bool redraw = false; |
220 | 220 | ||
221 | if (TIME_BEFORE(last_redraw+HZ/2, current_tick)) | 221 | if (TIME_BEFORE(last_redraw+HZ/2, current_tick)) |
222 | redraw = true; | 222 | redraw = true; |
223 | switch (action) | 223 | switch (action) |
@@ -244,7 +244,7 @@ static int time_menu_callback(int action, | |||
244 | } | 244 | } |
245 | return action; | 245 | return action; |
246 | } | 246 | } |
247 | 247 | ||
248 | 248 | ||
249 | MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), time_menu_callback, Icon_NOICON, | 249 | MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), time_menu_callback, Icon_NOICON, |
250 | &time_set, &sleep_timer_call, | 250 | &time_set, &sleep_timer_call, |
@@ -255,7 +255,7 @@ MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), time_menu_callback, Icon_NOICON, | |||
255 | #endif | 255 | #endif |
256 | #endif | 256 | #endif |
257 | &timeformat); | 257 | &timeformat); |
258 | 258 | ||
259 | int time_screen(void* ignored) | 259 | int time_screen(void* ignored) |
260 | { | 260 | { |
261 | (void)ignored; | 261 | (void)ignored; |
@@ -289,12 +289,8 @@ int time_screen(void* ignored) | |||
289 | } | 289 | } |
290 | else /* disable the clock drawing */ | 290 | else /* disable the clock drawing */ |
291 | clock[i].height = 0; | 291 | clock[i].height = 0; |
292 | menu[i].y = clock[i].y + clock[i].height; | 292 | menu[i].y += clock[i].height; |
293 | menu[i].height = screens[i].lcdheight - menu[i].y; | 293 | menu[i].height -= clock[i].height; |
294 | #ifdef HAVE_BUTTONBAR | ||
295 | if (global_settings.buttonbar) | ||
296 | menu[i].height -= BUTTONBAR_HEIGHT; | ||
297 | #endif | ||
298 | draw_timedate(&clock[i], &screens[i]); | 294 | draw_timedate(&clock[i], &screens[i]); |
299 | } | 295 | } |
300 | ret = do_menu(&time_menu, NULL, menu, false); | 296 | ret = do_menu(&time_menu, NULL, menu, false); |