diff options
Diffstat (limited to 'apps/gui/statusbar.c')
-rw-r--r-- | apps/gui/statusbar.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index 4710ebac42..bc5570ee4e 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c | |||
@@ -184,7 +184,7 @@ static void gui_statusbar_init(struct gui_statusbar * bar) | |||
184 | (vp).y = (display)->lcdheight - STATUSBAR_HEIGHT; \ | 184 | (vp).y = (display)->lcdheight - STATUSBAR_HEIGHT; \ |
185 | } while(0) | 185 | } while(0) |
186 | 186 | ||
187 | void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | 187 | void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw, struct viewport *vp) |
188 | { | 188 | { |
189 | struct screen * display = bar->display; | 189 | struct screen * display = bar->display; |
190 | 190 | ||
@@ -194,6 +194,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
194 | #ifdef HAVE_LCD_CHARCELLS | 194 | #ifdef HAVE_LCD_CHARCELLS |
195 | int val; | 195 | int val; |
196 | (void)force_redraw; /* The Player always has "redraw" */ | 196 | (void)force_redraw; /* The Player always has "redraw" */ |
197 | (void)vp; | ||
197 | #endif /* HAVE_LCD_CHARCELLS */ | 198 | #endif /* HAVE_LCD_CHARCELLS */ |
198 | 199 | ||
199 | bar->info.battlevel = battery_level(); | 200 | bar->info.battlevel = battery_level(); |
@@ -277,10 +278,16 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
277 | #endif | 278 | #endif |
278 | memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info))) | 279 | memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info))) |
279 | { | 280 | { |
280 | struct viewport vp; | 281 | if (vp == NULL) |
281 | 282 | { | |
282 | GET_RECT(vp,statusbar_position(display->screen_type),display); | 283 | struct viewport viewport; |
283 | display->set_viewport(&vp); | 284 | GET_RECT(viewport,statusbar_position(display->screen_type),display); |
285 | display->set_viewport(&viewport); | ||
286 | } | ||
287 | else | ||
288 | { | ||
289 | display->set_viewport(vp); | ||
290 | } | ||
284 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | 291 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
285 | display->fillrect(0, 0, display->getwidth(), STATUSBAR_HEIGHT); | 292 | display->fillrect(0, 0, display->getwidth(), STATUSBAR_HEIGHT); |
286 | display->set_drawmode(DRMODE_SOLID); | 293 | display->set_drawmode(DRMODE_SOLID); |
@@ -823,30 +830,10 @@ void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars, | |||
823 | #endif /* HAVE_LCD_BITMAP */ | 830 | #endif /* HAVE_LCD_BITMAP */ |
824 | int i; | 831 | int i; |
825 | FOR_NB_SCREENS(i) { | 832 | FOR_NB_SCREENS(i) { |
826 | gui_statusbar_draw( &(bars->statusbars[i]), force_redraw ); | 833 | gui_statusbar_draw( &(bars->statusbars[i]), force_redraw, NULL ); |
827 | } | 834 | } |
828 | } | 835 | } |
829 | 836 | ||
830 | #ifdef HAVE_LCD_BITMAP | ||
831 | void gui_statusbar_changed( enum screen_type screen, | ||
832 | enum statusbar_values old) | ||
833 | { | ||
834 | /* clear and update the statusbar area to remove old parts */ | ||
835 | enum statusbar_values bar = statusbar_position(screen); | ||
836 | |||
837 | struct screen *display = &screens[screen]; | ||
838 | struct viewport vp; | ||
839 | |||
840 | if (old != STATUSBAR_OFF && old != bar) | ||
841 | { | ||
842 | GET_RECT(vp, old, display); | ||
843 | display->set_viewport(&vp); | ||
844 | display->clear_viewport(); | ||
845 | display->update_viewport(); | ||
846 | display->set_viewport(NULL); | ||
847 | } | ||
848 | } | ||
849 | #endif | ||
850 | 837 | ||
851 | #ifdef HAVE_REMOTE_LCD | 838 | #ifdef HAVE_REMOTE_LCD |
852 | enum statusbar_values statusbar_position(int screen) | 839 | enum statusbar_values statusbar_position(int screen) |