From aad712d39f3cdeb95a22e56edb805554dd0a90e1 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 17 Mar 2009 01:56:20 +0000 Subject: Some style changes, move gwps_leave_wps a bit down; add a #define for restoration after 1 second and rename the one for instant restoration git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20330 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/gwps.c | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 4dc463be35..6d40ef08c2 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c @@ -65,23 +65,8 @@ #include "viewport.h" #include "pcmbuf.h" -#define GWPS_INSTANT_RESTORE 0 - -static void gwps_leave_wps(void) -{ - int oldbars = VP_SB_HIDE_ALL; - - if (global_settings.statusbar) - oldbars = VP_SB_ALLSCREENS; - - viewportmanager_set_statusbar(oldbars); -#if LCD_DEPTH > 1 - show_main_backdrop(); -#endif -#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 - show_remote_main_backdrop(); -#endif -} +#define RESTORE_WPS_INSTANTLY 0l +#define RESTORE_WPS_NEXT_SECOND ((long)(HZ+current_tick)) static int wpsbars; /* currently only one wps_state is needed */ @@ -185,6 +170,22 @@ void gwps_fix_statusbars(void) } +static void gwps_leave_wps(void) +{ + int oldbars = VP_SB_HIDE_ALL; + + if (global_settings.statusbar) + oldbars = VP_SB_ALLSCREENS; + + viewportmanager_set_statusbar(oldbars); +#if LCD_DEPTH > 1 + show_main_backdrop(); +#endif +#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 + show_remote_main_backdrop(); +#endif +} + /* The WPS can be left in two ways: * a) call a function, which draws over the wps. In this case, the wps * will be still active (i.e. the below function didn't return) @@ -198,7 +199,7 @@ long gui_wps_show(void) { long button = 0; bool restore = false; - long restoretimer = GWPS_INSTANT_RESTORE; /* timer to delay screen redraw temporarily */ + long restoretimer = RESTORE_WPS_INSTANTLY; /* timer to delay screen redraw temporarily */ bool exit = false; bool bookmark = false; bool update_track = false; @@ -396,7 +397,7 @@ long gui_wps_show(void) } if (res) { restore = true; - restoretimer = current_tick + HZ; + restoretimer = RESTORE_WPS_NEXT_SECOND; } } break; @@ -416,7 +417,7 @@ long gui_wps_show(void) } if (res) { restore = true; - restoretimer = current_tick + HZ; + restoretimer = RESTORE_WPS_NEXT_SECOND; } } break; @@ -680,7 +681,7 @@ long gui_wps_show(void) } if (restore && - ((restoretimer == GWPS_INSTANT_RESTORE) || + ((restoretimer == RESTORE_WPS_INSTANTLY) || TIME_AFTER(restore, current_tick))) { /* restore wps backrops and statusbars */ @@ -692,7 +693,7 @@ long gui_wps_show(void) #endif viewportmanager_set_statusbar(wpsbars); restore = false; - restoretimer = GWPS_INSTANT_RESTORE; + restoretimer = RESTORE_WPS_INSTANTLY; if (gui_wps_display()) { exit = true; } -- cgit v1.2.3