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 | |
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')
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 26 | ||||
-rw-r--r-- | apps/gui/skin_engine/wps_internals.h | 1 | ||||
-rw-r--r-- | apps/gui/statusbar-skinned.c | 2 |
3 files changed, 14 insertions, 15 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 } diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h index b0f5f36eb5..839a066a2d 100644 --- a/apps/gui/skin_engine/wps_internals.h +++ b/apps/gui/skin_engine/wps_internals.h @@ -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 '_' diff --git a/apps/gui/statusbar-skinned.c b/apps/gui/statusbar-skinned.c index 0902950599..179e69661a 100644 --- a/apps/gui/statusbar-skinned.c +++ b/apps/gui/statusbar-skinned.c @@ -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) |