diff options
-rw-r--r-- | apps/action.c | 3 | ||||
-rw-r--r-- | apps/gui/gwps.c | 35 | ||||
-rw-r--r-- | apps/gui/list.c | 3 | ||||
-rw-r--r-- | apps/gui/viewport.c | 6 | ||||
-rw-r--r-- | apps/gui/viewport.h | 2 | ||||
-rw-r--r-- | apps/screens.c | 3 |
6 files changed, 43 insertions, 9 deletions
diff --git a/apps/action.c b/apps/action.c index aad5348e48..c2a6e47ebe 100644 --- a/apps/action.c +++ b/apps/action.c @@ -105,6 +105,9 @@ static inline int get_next_context(const struct button_mapping *items, int i) TIMEOUT_BLOCK to wait for a button press Any number >0 to wait that many ticks for a press + This function will likely return SYS_FOURHERTZ which should be passed to the + default_event_handler(). If this doesnt happen parts of the GUI may not be + redrawn correctly */ static int get_action_worker(int context, int timeout, const struct button_mapping* (*get_context_map)(int) ) diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 71a8a01fc4..6faf6e91f9 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c @@ -210,6 +210,8 @@ long gui_wps_show(void) if (button != ACTION_NONE) { break; } + else if (button == SYS_FOURHERTZ) + default_event_handler(button); peak_meter_peek(); sleep(0); /* Sleep until end of current tick. */ @@ -267,18 +269,21 @@ long gui_wps_show(void) switch(button) { case ACTION_WPS_CONTEXT: + { + bool bars; #if LCD_DEPTH > 1 show_main_backdrop(); #endif #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 show_remote_main_backdrop(); #endif + bars = viewportmanager_set_statusbar(true); /* if music is stopped in the context menu we want to exit the wps */ if (onplay(wps_state.id3->path, FILE_ATTR_AUDIO, CONTEXT_WPS) == ONPLAY_MAINMENU || !audio_status()) return GO_TO_ROOT; - + viewportmanager_set_statusbar(bars); /* track might have changed */ update_track = true; @@ -289,7 +294,8 @@ long gui_wps_show(void) show_remote_wps_backdrop(); #endif restore = true; - break; + } + break; case ACTION_WPS_BROWSE: #ifdef HAVE_LCD_CHARCELLS @@ -531,6 +537,8 @@ long gui_wps_show(void) #ifdef HAVE_QUICKSCREEN case ACTION_WPS_QUICKSCREEN: + { + bool bars = viewportmanager_set_statusbar(true); #if LCD_DEPTH > 1 show_main_backdrop(); #endif @@ -539,6 +547,7 @@ long gui_wps_show(void) #endif if (quick_screen_quick(button)) return SYS_USB_CONNECTED; + viewportmanager_set_statusbar(bars); #if LCD_DEPTH > 1 show_wps_backdrop(); #endif @@ -546,12 +555,15 @@ long gui_wps_show(void) show_remote_wps_backdrop(); #endif restore = true; - break; + } + break; #endif /* HAVE_QUICKSCREEN */ /* screen settings */ #ifdef BUTTON_F3 case ACTION_F3: + { + bool bars = viewportmanager_set_statusbar(true); #if LCD_DEPTH > 1 show_main_backdrop(); #endif @@ -561,12 +573,16 @@ long gui_wps_show(void) if (quick_screen_f3(BUTTON_F3)) return SYS_USB_CONNECTED; restore = true; - break; + viewportmanager_set_statusbar(bars); + } + break; #endif /* BUTTON_F3 */ /* pitch screen */ #ifdef HAVE_PITCHSCREEN case ACTION_WPS_PITCHSCREEN: + { + bool bars = viewportmanager_set_statusbar(true); #if LCD_DEPTH > 1 show_main_backdrop(); #endif @@ -582,7 +598,9 @@ long gui_wps_show(void) show_remote_wps_backdrop(); #endif restore = true; - break; + viewportmanager_set_statusbar(bars); + } + break; #endif /* HAVE_PITCHSCREEN */ #ifdef AB_REPEAT_ENABLE @@ -605,6 +623,8 @@ long gui_wps_show(void) break; case ACTION_WPS_ID3SCREEN: + { + bool bars = viewportmanager_set_statusbar(true); #if LCD_DEPTH > 1 show_main_backdrop(); #endif @@ -619,7 +639,9 @@ long gui_wps_show(void) show_remote_wps_backdrop(); #endif restore = true; - break; + viewportmanager_set_statusbar(bars); + } + break; case ACTION_REDRAW: /* yes are locked, just redraw */ restore = true; @@ -634,6 +656,7 @@ long gui_wps_show(void) break; #endif case SYS_POWEROFF: + viewportmanager_set_statusbar(true); #if LCD_DEPTH > 1 show_main_backdrop(); #endif diff --git a/apps/gui/list.c b/apps/gui/list.c index b70cf424ee..9843339dd4 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -649,6 +649,9 @@ bool gui_synclist_do_button(struct gui_synclist * lists, switch (action) { + case SYS_FOURHERTZ: + default_event_handler(action); + return true; case ACTION_REDRAW: gui_synclist_draw(lists); return true; diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index 9cd905fa14..9a0657d510 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c @@ -86,9 +86,10 @@ void viewport_set_defaults(struct viewport *vp, enum screen_type screen) #endif } - -void viewportmanager_set_statusbar(bool enabled) +/* returns true if it was enabled BEFORE this call */ +bool viewportmanager_set_statusbar(bool enabled) { + bool old = statusbar_enabled; if (enabled && global_settings.statusbar) { add_event(GUI_EVENT_FOURHERTZ, false, viewportmanager_draw_statusbars); @@ -99,6 +100,7 @@ void viewportmanager_set_statusbar(bool enabled) remove_event(GUI_EVENT_FOURHERTZ, viewportmanager_draw_statusbars); } statusbar_enabled = enabled; + return old; } void viewportmanager_draw_statusbars(void* data) diff --git a/apps/gui/viewport.h b/apps/gui/viewport.h index cdb481017a..53f522347f 100644 --- a/apps/gui/viewport.h +++ b/apps/gui/viewport.h @@ -41,7 +41,7 @@ int viewport_load_config(const char *config, struct viewport *vp); void viewport_set_defaults(struct viewport *vp, enum screen_type screen); -void viewportmanager_set_statusbar(bool enabled); +bool viewportmanager_set_statusbar(bool enabled); /* callbacks for GUI_EVENT_* events */ void viewportmanager_draw_statusbars(void*data); void viewportmanager_statusbar_changed(void* data); diff --git a/apps/screens.c b/apps/screens.c index 8a787a5ca1..5509f839d2 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -679,6 +679,9 @@ bool shutdown_screen(void) * is terminated by TIME_BEFORE */ case ACTION_NONE: break; + case SYS_FOURHERTZ: + default_event_handler(button); + break; default: if(default_event_handler(button) == SYS_USB_CONNECTED) |