summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/gwps.c12
-rw-r--r--apps/gui/statusbar.c17
-rw-r--r--apps/gui/statusbar.h5
-rw-r--r--apps/gui/viewport.c17
-rw-r--r--apps/gui/wps_parser.c22
5 files changed, 32 insertions, 41 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c
index 64b8939ee9..95cca5c117 100644
--- a/apps/gui/gwps.c
+++ b/apps/gui/gwps.c
@@ -245,8 +245,8 @@ static void gwps_fix_statusbars(void)
245 bool draw = false; 245 bool draw = false;
246 if (gui_wps[i].data->wps_sb_tag) 246 if (gui_wps[i].data->wps_sb_tag)
247 draw = gui_wps[i].data->show_sb_on_wps; 247 draw = gui_wps[i].data->show_sb_on_wps;
248 else if (global_settings.statusbar) 248 else if (statusbar_position(i) != STATUSBAR_OFF)
249 wpsbars |= VP_SB_ONSCREEN(i); 249 draw = true;
250 if (draw) 250 if (draw)
251 wpsbars |= (VP_SB_ONSCREEN(i) | VP_SB_IGNORE_SETTING(i)); 251 wpsbars |= (VP_SB_ONSCREEN(i) | VP_SB_IGNORE_SETTING(i));
252 } 252 }
@@ -937,13 +937,7 @@ static void statusbar_toggle_handler(void *data)
937 } 937 }
938 else 938 else
939 { 939 {
940 bool bar_at_top = true; 940 bool bar_at_top = statusbar_position(i) != STATUSBAR_BOTTOM;
941#ifdef HAVE_REMOTE_LCD
942 if (i == SCREEN_REMOTE)
943 bar_at_top = global_settings.remote_statusbar != STATUSBAR_BOTTOM;
944 else
945#endif
946 bar_at_top = global_settings.statusbar != STATUSBAR_BOTTOM;
947 vp->y = bar_at_top?STATUSBAR_HEIGHT:0; 941 vp->y = bar_at_top?STATUSBAR_HEIGHT:0;
948 vp->height = screens[i].lcdheight - STATUSBAR_HEIGHT; 942 vp->height = screens[i].lcdheight - STATUSBAR_HEIGHT;
949 } 943 }
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index dca4169603..47dcb4ead1 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -263,17 +263,10 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
263 memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info))) 263 memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info)))
264 { 264 {
265 struct viewport vp; 265 struct viewport vp;
266 bool bar_at_top = true;
267 viewport_set_defaults(&vp, display->screen_type); 266 viewport_set_defaults(&vp, display->screen_type);
268 vp.height = STATUSBAR_HEIGHT; 267 vp.height = STATUSBAR_HEIGHT;
269 vp.x = STATUSBAR_X_POS; 268 vp.x = STATUSBAR_X_POS;
270#ifdef HAVE_REMOTE_LCD 269 if (statusbar_position(display->screen_type) != STATUSBAR_BOTTOM)
271 if (display->screen_type == SCREEN_REMOTE)
272 bar_at_top = global_settings.remote_statusbar != STATUSBAR_BOTTOM;
273 else
274#endif
275 bar_at_top = global_settings.statusbar != STATUSBAR_BOTTOM;
276 if (bar_at_top)
277 vp.y = 0; 270 vp.y = 0;
278 else 271 else
279 vp.y = display->lcdheight - STATUSBAR_HEIGHT; 272 vp.y = display->lcdheight - STATUSBAR_HEIGHT;
@@ -829,3 +822,11 @@ void gui_statusbar_changed(int enabled)
829 (void)enabled; 822 (void)enabled;
830 send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL); 823 send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL);
831} 824}
825#ifdef HAVE_REMOTE_LCD
826int statusbar_position(int screen)
827{
828 if (screen == SCREEN_REMOTE)
829 return global_settings.remote_statusbar;
830 return global_settings.statusbar;
831}
832#endif
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h
index db0ff9d780..f346c92f5a 100644
--- a/apps/gui/statusbar.h
+++ b/apps/gui/statusbar.h
@@ -99,5 +99,10 @@ struct gui_syncstatusbar
99extern void gui_syncstatusbar_init(struct gui_syncstatusbar * bars); 99extern void gui_syncstatusbar_init(struct gui_syncstatusbar * bars);
100extern void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars, bool force_redraw); 100extern void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars, bool force_redraw);
101void gui_statusbar_changed(int enabled); 101void gui_statusbar_changed(int enabled);
102#ifndef HAVE_REMOTE_LCD
103#define statusbar_position(a) (global_settings.statusbar)
104#else
105int statusbar_position(int screen);
106#endif
102 107
103#endif /*_GUI_STATUSBAR_H_*/ 108#endif /*_GUI_STATUSBAR_H_*/
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index 81baf1eab6..d635c10481 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -53,11 +53,7 @@ static bool showing_bars(enum screen_type screen)
53 { 53 {
54#ifdef HAVE_LCD_BITMAP 54#ifdef HAVE_LCD_BITMAP
55 bool ignore = statusbar_enabled & VP_SB_IGNORE_SETTING(screen); 55 bool ignore = statusbar_enabled & VP_SB_IGNORE_SETTING(screen);
56#ifdef HAVE_REMOTE_LCD 56 return ignore || (statusbar_position(screen));
57 if (screen == SCREEN_REMOTE)
58 return global_settings.remote_statusbar || ignore;
59#endif
60 return global_settings.statusbar || ignore;
61#else 57#else
62 return true; 58 return true;
63#endif 59#endif
@@ -67,24 +63,15 @@ static bool showing_bars(enum screen_type screen)
67 63
68void viewport_set_defaults(struct viewport *vp, enum screen_type screen) 64void viewport_set_defaults(struct viewport *vp, enum screen_type screen)
69{ 65{
70#ifdef HAVE_LCD_BITMAP
71 bool bar_at_top = true;
72#endif
73 vp->x = 0; 66 vp->x = 0;
74 vp->width = screens[screen].lcdwidth; 67 vp->width = screens[screen].lcdwidth;
75 68
76#ifdef HAVE_LCD_BITMAP 69#ifdef HAVE_LCD_BITMAP
77 vp->drawmode = DRMODE_SOLID; 70 vp->drawmode = DRMODE_SOLID;
78 vp->font = FONT_UI; /* default to UI to discourage SYSFONT use */ 71 vp->font = FONT_UI; /* default to UI to discourage SYSFONT use */
79#ifdef HAVE_REMOTE_LCD
80 if (screen == SCREEN_REMOTE)
81 bar_at_top = global_settings.remote_statusbar != STATUSBAR_BOTTOM;
82 else
83#endif
84 bar_at_top = global_settings.statusbar != STATUSBAR_BOTTOM;
85 72
86 vp->height = screens[screen].lcdheight; 73 vp->height = screens[screen].lcdheight;
87 if (bar_at_top && showing_bars(screen)) 74 if (statusbar_position(screen) != STATUSBAR_BOTTOM && showing_bars(screen))
88 vp->y = STATUSBAR_HEIGHT; 75 vp->y = STATUSBAR_HEIGHT;
89 else 76 else
90 vp->y = 0; 77 vp->y = 0;
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index 14c8d30c6a..09bcab8443 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -1682,16 +1682,20 @@ bool wps_data_load(struct wps_data *wps_data,
1682 /* Initialise the first (default) viewport */ 1682 /* Initialise the first (default) viewport */
1683 wps_data->viewports[0].vp.x = 0; 1683 wps_data->viewports[0].vp.x = 0;
1684 wps_data->viewports[0].vp.width = display->getwidth(); 1684 wps_data->viewports[0].vp.width = display->getwidth();
1685 if (!global_settings.statusbar) 1685 wps_data->viewports[0].vp.height = display->getheight();
1686 switch (statusbar_position(display->screen_type))
1686 { 1687 {
1687 wps_data->viewports[0].vp.y = 0; 1688 case STATUSBAR_OFF:
1688 wps_data->viewports[0].vp.height = display->getheight(); 1689 wps_data->viewports[0].vp.y = 0;
1689 } 1690 break;
1690 else 1691 case STATUSBAR_TOP:
1691 { 1692 wps_data->viewports[0].vp.y = STATUSBAR_HEIGHT;
1692 wps_data->viewports[0].vp.y = STATUSBAR_HEIGHT; 1693 wps_data->viewports[0].vp.height -= STATUSBAR_HEIGHT;
1693 wps_data->viewports[0].vp.height = display->getheight() - 1694 break;
1694 STATUSBAR_HEIGHT; 1695 case STATUSBAR_BOTTOM:
1696 wps_data->viewports[0].vp.y = 0;
1697 wps_data->viewports[0].vp.height -= STATUSBAR_HEIGHT;
1698 break;
1695 } 1699 }
1696#ifdef HAVE_LCD_BITMAP 1700#ifdef HAVE_LCD_BITMAP
1697 wps_data->viewports[0].vp.font = FONT_UI; 1701 wps_data->viewports[0].vp.font = FONT_UI;