summaryrefslogtreecommitdiff
path: root/apps/menus/time_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/menus/time_menu.c')
-rw-r--r--apps/menus/time_menu.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c
index 597f7e0c3a..a529837b07 100644
--- a/apps/menus/time_menu.c
+++ b/apps/menus/time_menu.c
@@ -22,9 +22,9 @@
22#include <stdbool.h> 22#include <stdbool.h>
23#include <stddef.h> 23#include <stddef.h>
24#include <limits.h> 24#include <limits.h>
25#include <stdio.h>
25#include "config.h" 26#include "config.h"
26#include "string.h" 27#include "string.h"
27#include "sprintf.h"
28#include "lang.h" 28#include "lang.h"
29#include "action.h" 29#include "action.h"
30#include "settings.h" 30#include "settings.h"
@@ -201,7 +201,7 @@ static void draw_timedate(struct viewport *vp, struct screen *display)
201} 201}
202 202
203 203
204static struct viewport clock[NB_SCREENS], menu[NB_SCREENS]; 204static struct viewport clock_vps[NB_SCREENS], menu[NB_SCREENS];
205static bool menu_was_pressed; 205static bool menu_was_pressed;
206static int time_menu_callback(int action, 206static int time_menu_callback(int action,
207 const struct menu_item_ex *this_item) 207 const struct menu_item_ex *this_item)
@@ -233,7 +233,7 @@ static int time_menu_callback(int action,
233 { 233 {
234 last_redraw = current_tick; 234 last_redraw = current_tick;
235 FOR_NB_SCREENS(i) 235 FOR_NB_SCREENS(i)
236 draw_timedate(&clock[i], &screens[i]); 236 draw_timedate(&clock_vps[i], &screens[i]);
237 } 237 }
238 return action; 238 return action;
239} 239}
@@ -257,30 +257,30 @@ int time_screen(void* ignored)
257 257
258 FOR_NB_SCREENS(i) 258 FOR_NB_SCREENS(i)
259 { 259 {
260 viewport_set_defaults(&clock[i], i); 260 viewport_set_defaults(&clock_vps[i], i);
261#ifdef HAVE_BUTTONBAR 261#ifdef HAVE_BUTTONBAR
262 if (global_settings.buttonbar) 262 if (global_settings.buttonbar)
263 { 263 {
264 clock[i].height -= BUTTONBAR_HEIGHT; 264 clock_vps[i].height -= BUTTONBAR_HEIGHT;
265 } 265 }
266#endif 266#endif
267 nb_lines = viewport_get_nb_lines(&clock[i]); 267 nb_lines = viewport_get_nb_lines(&clock_vps[i]);
268 268
269 menu[i] = clock[i]; 269 menu[i] = clock_vps[i];
270 /* force time to be drawn centered */ 270 /* force time to be drawn centered */
271 clock[i].flags |= VP_FLAG_ALIGN_CENTER; 271 clock_vps[i].flags |= VP_FLAG_ALIGN_CENTER;
272 272
273 font_h = font_get(clock[i].font)->height; 273 font_h = font_get(clock_vps[i].font)->height;
274 nb_lines -= 2; /* at least 2 lines for menu */ 274 nb_lines -= 2; /* at least 2 lines for menu */
275 if (nb_lines > 4) 275 if (nb_lines > 4)
276 nb_lines = 4; 276 nb_lines = 4;
277 if (nb_lines >= 2) 277 if (nb_lines >= 2)
278 clock[i].height = nb_lines*font_h; 278 clock_vps[i].height = nb_lines*font_h;
279 else /* disable the clock drawing */ 279 else /* disable the clock_vps drawing */
280 clock[i].height = 0; 280 clock_vps[i].height = 0;
281 menu[i].y += clock[i].height; 281 menu[i].y += clock_vps[i].height;
282 menu[i].height -= clock[i].height; 282 menu[i].height -= clock_vps[i].height;
283 draw_timedate(&clock[i], &screens[i]); 283 draw_timedate(&clock_vps[i], &screens[i]);
284 } 284 }
285 285
286 ret = do_menu(&time_menu, NULL, menu, false); 286 ret = do_menu(&time_menu, NULL, menu, false);