1
0
Fork 0
forked from len0rd/rockbox

there is a difference between viewports which shouldnt be cleared (the default viewport in the sbs) and viewports which should never be shown (%Vi viewport). so do this properly

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25271 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2010-03-21 13:27:55 +00:00
parent 165709b076
commit 4160fd91a7
3 changed files with 15 additions and 16 deletions

View file

@ -1123,11 +1123,10 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
struct skin_viewport *skin_viewport =
(struct skin_viewport *)viewport_list->token->value.data;
unsigned vp_refresh_mode = refresh_mode;
unsigned hidden_flags = skin_viewport->hidden_flags;
display->set_viewport(&skin_viewport->vp);
int hidden_vp = 0;
#ifdef HAVE_LCD_BITMAP
/* Set images to not to be displayed */
struct skin_token_list *imglist = data->images;
@ -1138,19 +1137,18 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
imglist = imglist->next;
}
#endif
/* dont redraw the viewport if its disabled */
if (skin_viewport->hidden_flags&VP_NEVER_VISIBLE)
{ /* don't draw anything into this one */
vp_refresh_mode = 0; hidden_vp = true;
}
else if ((skin_viewport->hidden_flags&VP_DRAW_HIDDEN))
if ((hidden_flags&VP_NEVER_VISIBLE))
{
if (!(skin_viewport->hidden_flags&VP_DRAW_WASHIDDEN))
continue;
}
if ((hidden_flags&VP_DRAW_HIDDEN))
{
if (!(hidden_flags&VP_DRAW_WASHIDDEN))
display->scroll_stop(&skin_viewport->vp);
skin_viewport->hidden_flags |= VP_DRAW_WASHIDDEN;
continue;
}
else if (((skin_viewport->hidden_flags&
else if (((hidden_flags&
(VP_DRAW_WASHIDDEN|VP_DRAW_HIDEABLE))
== (VP_DRAW_WASHIDDEN|VP_DRAW_HIDEABLE)))
{
@ -1160,6 +1158,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
if (vp_refresh_mode == WPS_REFRESH_ALL)
{
if (!(hidden_flags&VP_NEVER_CLEAR))
display->clear_viewport();
}
@ -1179,7 +1178,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
flags = line->curr_subline->line_type;
if (vp_refresh_mode == WPS_REFRESH_ALL || (flags & vp_refresh_mode)
|| new_subline_refresh || hidden_vp)
|| new_subline_refresh)
{
/* get_line tells us if we need to update the line */
update_line = get_line(gwps, subline, &align,
@ -1225,7 +1224,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
}
#endif
if (update_line && !hidden_vp &&
if (update_line &&
/* conditionals clear the line which means if the %Vd is put into the default
viewport there will be a blank line.
To get around this we dont allow any actual drawing to happen in the
@ -1254,7 +1253,6 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
}
}
/* Now display any images in this viewport */
if (!hidden_vp)
wps_display_images(gwps, &skin_viewport->vp);
#endif
}

View file

@ -197,6 +197,7 @@ struct skin_line {
#define VP_DRAW_WASHIDDEN 0x4
/* these are never drawn, nor cleared, i.e. just ignored */
#define VP_NEVER_VISIBLE 0x8
#define VP_NEVER_CLEAR 0x10
#define VP_DEFAULT_LABEL '|'
#define VP_NO_LABEL '-'
#define VP_INFO_LABEL '_'

View file

@ -85,7 +85,7 @@ void sb_skin_data_load(enum screen_type screen, const char *buf, bool isfile)
success = false;
}
/* hide this viewport, forever */
vp->hidden_flags = VP_NEVER_VISIBLE;
vp->hidden_flags = VP_NEVER_CLEAR;
}
if (!success && isfile)