diff options
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/gwps.c | 9 | ||||
-rw-r--r-- | apps/gui/statusbar.c | 14 | ||||
-rw-r--r-- | apps/gui/statusbar.h | 2 | ||||
-rw-r--r-- | apps/gui/viewport.c | 34 |
4 files changed, 50 insertions, 9 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 0b41f88cdc..64b8939ee9 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c | |||
@@ -937,7 +937,14 @@ static void statusbar_toggle_handler(void *data) | |||
937 | } | 937 | } |
938 | else | 938 | else |
939 | { | 939 | { |
940 | vp->y = STATUSBAR_HEIGHT; | 940 | bool bar_at_top = true; |
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->height = screens[i].lcdheight - STATUSBAR_HEIGHT; | 948 | vp->height = screens[i].lcdheight - STATUSBAR_HEIGHT; |
942 | } | 949 | } |
943 | } | 950 | } |
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index ec804ab41f..dca4169603 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c | |||
@@ -263,10 +263,20 @@ 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; | ||
266 | viewport_set_defaults(&vp, display->screen_type); | 267 | viewport_set_defaults(&vp, display->screen_type); |
267 | vp.height = STATUSBAR_HEIGHT; | 268 | vp.height = STATUSBAR_HEIGHT; |
268 | vp.x = STATUSBAR_X_POS; | 269 | vp.x = STATUSBAR_X_POS; |
269 | vp.y = STATUSBAR_Y_POS; | 270 | #ifdef HAVE_REMOTE_LCD |
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; | ||
278 | else | ||
279 | vp.y = display->lcdheight - STATUSBAR_HEIGHT; | ||
270 | display->set_viewport(&vp); | 280 | display->set_viewport(&vp); |
271 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | 281 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
272 | display->fillrect(0, 0, display->getwidth(), STATUSBAR_HEIGHT); | 282 | display->fillrect(0, 0, display->getwidth(), STATUSBAR_HEIGHT); |
@@ -814,7 +824,7 @@ void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars, | |||
814 | } | 824 | } |
815 | } | 825 | } |
816 | 826 | ||
817 | void gui_statusbar_changed(bool enabled) | 827 | void gui_statusbar_changed(int enabled) |
818 | { | 828 | { |
819 | (void)enabled; | 829 | (void)enabled; |
820 | send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL); | 830 | send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL); |
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h index f6203c22d9..db0ff9d780 100644 --- a/apps/gui/statusbar.h +++ b/apps/gui/statusbar.h | |||
@@ -98,6 +98,6 @@ struct gui_syncstatusbar | |||
98 | 98 | ||
99 | extern void gui_syncstatusbar_init(struct gui_syncstatusbar * bars); | 99 | extern void gui_syncstatusbar_init(struct gui_syncstatusbar * bars); |
100 | extern void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars, bool force_redraw); | 100 | extern void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars, bool force_redraw); |
101 | void gui_statusbar_changed(bool enabled); | 101 | void gui_statusbar_changed(int enabled); |
102 | 102 | ||
103 | #endif /*_GUI_STATUSBAR_H_*/ | 103 | #endif /*_GUI_STATUSBAR_H_*/ |
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index 22d3eb3eb8..67f63e349b 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c | |||
@@ -49,30 +49,47 @@ int viewport_get_nb_lines(struct viewport *vp) | |||
49 | 49 | ||
50 | static bool showing_bars(enum screen_type screen) | 50 | static bool showing_bars(enum screen_type screen) |
51 | { | 51 | { |
52 | bool ignore = statusbar_enabled & VP_SB_IGNORE_SETTING(screen); | ||
52 | if (statusbar_enabled & VP_SB_ONSCREEN(screen)) | 53 | if (statusbar_enabled & VP_SB_ONSCREEN(screen)) |
54 | { | ||
53 | #ifdef HAVE_LCD_BITMAP | 55 | #ifdef HAVE_LCD_BITMAP |
54 | return global_settings.statusbar || | 56 | #ifdef HAVE_REMOTE_LCD |
55 | (statusbar_enabled & VP_SB_IGNORE_SETTING(screen)); | 57 | if (screen == SCREEN_REMOTE) |
58 | return global_settings.remote_statusbar || ignore; | ||
59 | #endif | ||
60 | return global_settings.statusbar || ignore; | ||
56 | #else | 61 | #else |
57 | return true; | 62 | return true; |
58 | #endif | 63 | #endif |
64 | } | ||
59 | return false; | 65 | return false; |
60 | } | 66 | } |
61 | 67 | ||
62 | void viewport_set_defaults(struct viewport *vp, enum screen_type screen) | 68 | void viewport_set_defaults(struct viewport *vp, enum screen_type screen) |
63 | { | 69 | { |
70 | bool bar_at_top = true; | ||
64 | vp->x = 0; | 71 | vp->x = 0; |
65 | vp->width = screens[screen].lcdwidth; | 72 | vp->width = screens[screen].lcdwidth; |
66 | 73 | ||
67 | #ifdef HAVE_LCD_BITMAP | 74 | #ifdef HAVE_LCD_BITMAP |
68 | vp->drawmode = DRMODE_SOLID; | 75 | vp->drawmode = DRMODE_SOLID; |
69 | vp->font = FONT_UI; /* default to UI to discourage SYSFONT use */ | 76 | vp->font = FONT_UI; /* default to UI to discourage SYSFONT use */ |
70 | 77 | #ifdef HAVE_REMOTE_LCD | |
71 | vp->y = showing_bars(screen)?STATUSBAR_HEIGHT:0; | 78 | if (screen == SCREEN_REMOTE) |
79 | bar_at_top = global_settings.remote_statusbar != STATUSBAR_BOTTOM; | ||
80 | else | ||
81 | #endif | ||
82 | bar_at_top = global_settings.statusbar != STATUSBAR_BOTTOM; | ||
83 | |||
84 | vp->height = screens[screen].lcdheight; | ||
85 | if (bar_at_top && showing_bars(screen)) | ||
86 | vp->y = STATUSBAR_HEIGHT; | ||
87 | else | ||
88 | vp->y = 0; | ||
72 | #else | 89 | #else |
73 | vp->y = 0; | 90 | vp->y = 0; |
74 | #endif | 91 | #endif |
75 | vp->height = screens[screen].lcdheight - vp->y; | 92 | vp->height = screens[screen].lcdheight - (showing_bars(screen)?STATUSBAR_HEIGHT:0); |
76 | 93 | ||
77 | #ifdef HAVE_REMOTE_LCD | 94 | #ifdef HAVE_REMOTE_LCD |
78 | /* We only need this test if there is a remote LCD */ | 95 | /* We only need this test if there is a remote LCD */ |
@@ -136,5 +153,12 @@ void viewportmanager_draw_statusbars(void* data) | |||
136 | void viewportmanager_statusbar_changed(void* data) | 153 | void viewportmanager_statusbar_changed(void* data) |
137 | { | 154 | { |
138 | (void)data; | 155 | (void)data; |
156 | statusbar_enabled = 0; | ||
157 | if (global_settings.statusbar != STATUSBAR_OFF) | ||
158 | statusbar_enabled = VP_SB_ONSCREEN(SCREEN_MAIN); | ||
159 | #ifdef HAVE_REMOTE_LCD | ||
160 | if (global_settings.remote_statusbar != STATUSBAR_OFF) | ||
161 | statusbar_enabled |= VP_SB_ONSCREEN(SCREEN_REMOTE); | ||
162 | #endif | ||
139 | viewportmanager_set_statusbar(statusbar_enabled); | 163 | viewportmanager_set_statusbar(statusbar_enabled); |
140 | } | 164 | } |