mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-10 08:03:04 -04:00
quickscreen: always refresh SBS when leaving
Eliminate special case for transition to the Shortcuts menu.
The SBS refresh doesn't cause a screen update anymore, and
has negligible cost, so do it regardless.
Reverts the changes to quickscreen.c introduced in commit
dfd9c10 ("Eliminate skin updates in between activities")
+ simplify quickscreen_draw_item (no effect on behavior)
Change-Id: I3fca976de554c720cb69a41566fd0d0a7e6ea92d
This commit is contained in:
parent
8eefac3638
commit
81cf120983
2 changed files with 16 additions and 22 deletions
|
|
@ -185,14 +185,14 @@ static void quickscreen_fix_viewports(struct quickscreen *qs, enum screen_type s
|
|||
vps[QUICKSCREEN_RIGHT].flags |= VP_FLAG_ALIGN_RIGHT;
|
||||
}
|
||||
|
||||
/* Draw QS item into current viewport */
|
||||
static void quickscreen_draw_item(struct quickscreen *qs, struct screen *display,
|
||||
enum quickscreen_item i, bool single_line)
|
||||
/* Draw settings item into current viewport */
|
||||
static void quickscreen_draw_setting(const struct settings_list *item,
|
||||
struct screen *display, bool single_line)
|
||||
{
|
||||
char buf[MAX_PATH];
|
||||
const char *title = P2STR(ID2P(qs->items[i]->lang_id));
|
||||
const char *value = option_get_valuestring(qs->items[i], buf, sizeof buf,
|
||||
option_value_as_int(qs->items[i]));
|
||||
const char *title = P2STR(ID2P(item->lang_id));
|
||||
const char *value = option_get_valuestring(item, buf, sizeof buf,
|
||||
option_value_as_int(item));
|
||||
if (single_line)
|
||||
{
|
||||
char text[MAX_PATH];
|
||||
|
|
@ -222,7 +222,8 @@ static void quickscreen_update(struct quickscreen *qs, enum quickscreen_item sel
|
|||
{
|
||||
struct viewport *last_vp = display->set_viewport(&vps[i]);
|
||||
display->clear_viewport();
|
||||
quickscreen_draw_item(qs, display, i, viewport_get_nb_lines(&vps[i]) < 2);
|
||||
quickscreen_draw_setting(qs->items[i], display,
|
||||
viewport_get_nb_lines(&vps[i]) < 2);
|
||||
display->set_viewport(last_vp);
|
||||
}
|
||||
|
||||
|
|
@ -244,7 +245,8 @@ static void quickscreen_draw(struct quickscreen *qs, enum screen_type screen)
|
|||
if (qs->items[i])
|
||||
{
|
||||
display->set_viewport(&vps[i]);
|
||||
quickscreen_draw_item(qs, display, i, viewport_get_nb_lines(&vps[i]) < 2);
|
||||
quickscreen_draw_setting(qs->items[i], display,
|
||||
viewport_get_nb_lines(&vps[i]) < 2);
|
||||
}
|
||||
|
||||
/* icons */
|
||||
|
|
@ -389,13 +391,9 @@ static void cleanup(void *parameter)
|
|||
if (!qs_skinned[i])
|
||||
FOR_QS_ITEMS(j)
|
||||
screens[i].scroll_stop_viewport(&qs->vps[i][j]);
|
||||
viewportmanager_theme_undo(i, !(qs->result & QUICKSCREEN_GOTO_SHORTCUTS_MENU));
|
||||
viewportmanager_theme_undo(i, true);
|
||||
}
|
||||
/* Eliminate flashing of parent during transition to Shortcuts */
|
||||
if (qs->result & QUICKSCREEN_GOTO_SHORTCUTS_MENU)
|
||||
pop_current_activity_without_refresh();
|
||||
else
|
||||
pop_current_activity();
|
||||
pop_current_activity();
|
||||
}
|
||||
|
||||
/* Set up activity, viewport, and event listener. Draw initial Quickscreen. */
|
||||
|
|
|
|||
|
|
@ -1151,16 +1151,12 @@ enum playlist_viewer_result playlist_viewer_ex(const char* filename,
|
|||
goto exit;
|
||||
#ifdef HAVE_QUICKSCREEN
|
||||
case ACTION_STD_QUICKSCREEN:
|
||||
/* Shortcuts menu currently disabled in Playlist Viewer */
|
||||
if (!global_settings.shortcuts_replaces_qs)
|
||||
{
|
||||
if (quickscreen_show(button) ==
|
||||
QUICKSCREEN_GOTO_SHORTCUTS_MENU) /* currently disabled */
|
||||
{
|
||||
/* QuickScreen defers skin updates when popping its activity
|
||||
to switch to Shortcuts Menu, so make up for that here: */
|
||||
FOR_NB_SCREENS(i)
|
||||
skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL);
|
||||
}
|
||||
/* QUICKSCREEN_GOTO_SHORTCUTS_MENU
|
||||
return value ignored for now */
|
||||
quickscreen_show(button);
|
||||
update_playlist(true);
|
||||
update_gui(&playlist_lists, true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue