From 276dfa23b611a85bedebceb986d0b4549a934187 Mon Sep 17 00:00:00 2001 From: Yoshihisa Uchida Date: Wed, 7 Jul 2010 12:07:23 +0000 Subject: text viewer: fixed the following bugs. - the statusbar of the preferences is not correct when the settings file loads. - overlaps the statusbar of the skin and default one. (FS#11455) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27334 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/text_viewer/tv_display.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'apps/plugins/text_viewer/tv_display.c') diff --git a/apps/plugins/text_viewer/tv_display.c b/apps/plugins/text_viewer/tv_display.c index 8cf7e11419..57474cdc0f 100644 --- a/apps/plugins/text_viewer/tv_display.c +++ b/apps/plugins/text_viewer/tv_display.c @@ -314,16 +314,19 @@ void tv_get_drawarea_info(int *width, int *cols, int *rows) static void tv_change_viewport(void) { #ifdef HAVE_LCD_BITMAP - struct viewport vp; - if (is_initialized_vp) rb->viewportmanager_theme_undo(SCREEN_MAIN, false); else is_initialized_vp = true; - rb->viewportmanager_theme_enable(SCREEN_MAIN, preferences->statusbar, &vp); - vp_info = vp; + if (preferences->statusbar) + rb->memcpy(&vp_info, rb->sb_skin_get_info_vp(SCREEN_MAIN), sizeof(struct viewport)); + else + rb->viewport_set_defaults(&vp_info, SCREEN_MAIN); + + rb->viewportmanager_theme_enable(SCREEN_MAIN, preferences->statusbar, &vp_info); vp_info.flags &= ~VP_FLAG_ALIGNMENT_MASK; + display->set_viewport(&vp_info); #else if (!is_initialized_vp) { @@ -411,7 +414,8 @@ void tv_finalize_display(void) } /* undo viewport */ - rb->viewportmanager_theme_undo(SCREEN_MAIN, false); + if (is_initialized_vp) + rb->viewportmanager_theme_undo(SCREEN_MAIN, false); #endif } -- cgit v1.2.3