diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2010-03-21 13:27:55 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2010-03-21 13:27:55 +0000 |
commit | 4160fd91a76c34152fe40fc6c9b37354ff799a27 (patch) | |
tree | e9ddf3c73c57f49df56f8999dded5bf3d7d21740 /apps/gui/skin_engine/skin_display.c | |
parent | 165709b076b970a900e5090c2952f9033ce3aa9f (diff) |
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
Diffstat (limited to 'apps/gui/skin_engine/skin_display.c')
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 845ea18608..8ea5dc5ecb 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c @@ -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; + if ((hidden_flags&VP_NEVER_VISIBLE)) + { + continue; } - else if ((skin_viewport->hidden_flags&VP_DRAW_HIDDEN)) + if ((hidden_flags&VP_DRAW_HIDDEN)) { - if (!(skin_viewport->hidden_flags&VP_DRAW_WASHIDDEN)) + 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,7 +1158,8 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) if (vp_refresh_mode == WPS_REFRESH_ALL) { - display->clear_viewport(); + if (!(hidden_flags&VP_NEVER_CLEAR)) + display->clear_viewport(); } /* loop over the lines for this 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,8 +1253,7 @@ 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); + wps_display_images(gwps, &skin_viewport->vp); #endif } |