Fix FS#10841. Thanks to Thomas Martitz for spotting what was wrong.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23914 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c3a908f04b
commit
4862e28b67
1 changed files with 10 additions and 3 deletions
|
@ -128,9 +128,10 @@ struct usb_screen_vps_t
|
|||
};
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
static void usb_screen_fix_viewports(struct screen *screen,
|
||||
static bool usb_screen_fix_viewports(struct screen *screen,
|
||||
struct usb_screen_vps_t *usb_screen_vps)
|
||||
{
|
||||
bool theme_needs_undo = false;
|
||||
int logo_width, logo_height;
|
||||
struct viewport *parent = &usb_screen_vps->parent;
|
||||
struct viewport *logo = &usb_screen_vps->logo;
|
||||
|
@ -150,7 +151,10 @@ static void usb_screen_fix_viewports(struct screen *screen,
|
|||
|
||||
viewport_set_defaults(parent, screen->screen_type);
|
||||
if (parent->width < logo_width || parent->height < logo_height)
|
||||
{
|
||||
theme_needs_undo = true;
|
||||
viewportmanager_theme_enable(screen->screen_type, false, parent);
|
||||
}
|
||||
|
||||
*logo = *parent;
|
||||
logo->x = parent->x + parent->width - logo_width;
|
||||
|
@ -174,6 +178,7 @@ static void usb_screen_fix_viewports(struct screen *screen,
|
|||
}
|
||||
}
|
||||
#endif
|
||||
return theme_needs_undo;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -240,6 +245,7 @@ static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar)
|
|||
void gui_usb_screen_run(void)
|
||||
{
|
||||
int i;
|
||||
bool screen_theme_needs_undo[NB_SCREENS];
|
||||
struct usb_screen_vps_t usb_screen_vps_ar[NB_SCREENS];
|
||||
#if defined HAVE_TOUCHSCREEN
|
||||
enum touchscreen_mode old_mode = touchscreen_get_mode();
|
||||
|
@ -264,7 +270,7 @@ void gui_usb_screen_run(void)
|
|||
|
||||
screen->set_viewport(NULL);
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
usb_screen_fix_viewports(screen, &usb_screen_vps_ar[i]);
|
||||
screen_theme_needs_undo[i] = usb_screen_fix_viewports(screen, &usb_screen_vps_ar[i]);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -311,7 +317,8 @@ void gui_usb_screen_run(void)
|
|||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
screens[i].backlight_on();
|
||||
viewportmanager_theme_undo(i);
|
||||
if(screen_theme_needs_undo[i])
|
||||
viewportmanager_theme_undo(i);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue