mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Backport r24351: Fix multiscreen handling of the viewportmanager.
git-svn-id: svn://svn.rockbox.org/rockbox/branches/v3_5@24353 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
86240ceee9
commit
3173ed933e
1 changed files with 34 additions and 24 deletions
|
@ -69,16 +69,10 @@ static int theme_stack_top[NB_SCREENS]; /* the last item added */
|
||||||
static struct viewport_stack_item theme_stack[NB_SCREENS][VPSTACK_DEPTH];
|
static struct viewport_stack_item theme_stack[NB_SCREENS][VPSTACK_DEPTH];
|
||||||
static bool is_theme_enabled(enum screen_type screen);
|
static bool is_theme_enabled(enum screen_type screen);
|
||||||
|
|
||||||
static void toggle_theme(enum screen_type screen, bool force)
|
|
||||||
|
static void toggle_events(bool enable)
|
||||||
{
|
{
|
||||||
bool enable_event = false;
|
if (enable)
|
||||||
static bool was_enabled[NB_SCREENS] = {false};
|
|
||||||
int i;
|
|
||||||
FOR_NB_SCREENS(i)
|
|
||||||
{
|
|
||||||
enable_event = enable_event || is_theme_enabled(i);
|
|
||||||
}
|
|
||||||
if (enable_event)
|
|
||||||
{
|
{
|
||||||
add_event(GUI_EVENT_ACTIONUPDATE, false, viewportmanager_redraw);
|
add_event(GUI_EVENT_ACTIONUPDATE, false, viewportmanager_redraw);
|
||||||
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
|
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
|
||||||
|
@ -88,8 +82,34 @@ static void toggle_theme(enum screen_type screen, bool force)
|
||||||
do_sbs_update_callback);
|
do_sbs_update_callback);
|
||||||
add_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, false,
|
add_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, false,
|
||||||
do_sbs_update_callback);
|
do_sbs_update_callback);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
|
||||||
|
remove_event(LCD_EVENT_ACTIVATION, do_sbs_update_callback);
|
||||||
|
#endif
|
||||||
|
remove_event(PLAYBACK_EVENT_TRACK_CHANGE, do_sbs_update_callback);
|
||||||
|
remove_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, do_sbs_update_callback);
|
||||||
|
remove_event(GUI_EVENT_ACTIONUPDATE, viewportmanager_redraw);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if LCD_DEPTH > 1
|
|
||||||
|
static void toggle_theme(enum screen_type screen, bool force)
|
||||||
|
{
|
||||||
|
bool enable_event = false;
|
||||||
|
static bool was_enabled[NB_SCREENS] = {false};
|
||||||
|
int i;
|
||||||
|
|
||||||
|
FOR_NB_SCREENS(i)
|
||||||
|
{
|
||||||
|
enable_event = enable_event || is_theme_enabled(i);
|
||||||
|
}
|
||||||
|
toggle_events(enable_event);
|
||||||
|
|
||||||
|
if (is_theme_enabled(screen))
|
||||||
|
{
|
||||||
|
#if LCD_DEPTH > 1 || (defined(LCD_REMOTE_DEPTH) && LCD_REMOTE_DEPTH > 1)
|
||||||
screens[screen].backdrop_show(BACKDROP_MAIN);
|
screens[screen].backdrop_show(BACKDROP_MAIN);
|
||||||
#endif
|
#endif
|
||||||
/* remove the left overs from the previous screen.
|
/* remove the left overs from the previous screen.
|
||||||
|
@ -144,20 +164,10 @@ static void toggle_theme(enum screen_type screen, bool force)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FOR_NB_SCREENS(i)
|
#if LCD_DEPTH > 1 || (defined(LCD_REMOTE_DEPTH) && LCD_REMOTE_DEPTH > 1)
|
||||||
{
|
screens[screen].backdrop_hide();
|
||||||
#if LCD_DEPTH > 1
|
|
||||||
screens[i].backdrop_hide();
|
|
||||||
#endif
|
#endif
|
||||||
screens[i].stop_scroll();
|
screens[screen].stop_scroll();
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
|
|
||||||
remove_event(LCD_EVENT_ACTIVATION, do_sbs_update_callback);
|
|
||||||
#endif
|
|
||||||
remove_event(PLAYBACK_EVENT_TRACK_CHANGE, do_sbs_update_callback);
|
|
||||||
remove_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, do_sbs_update_callback);
|
|
||||||
remove_event(GUI_EVENT_ACTIONUPDATE, viewportmanager_redraw);
|
|
||||||
}
|
}
|
||||||
/* let list initialize viewport in case viewport dimensions is changed. */
|
/* let list initialize viewport in case viewport dimensions is changed. */
|
||||||
send_event(GUI_EVENT_THEME_CHANGED, NULL);
|
send_event(GUI_EVENT_THEME_CHANGED, NULL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue