mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
Fix skin engine calling wps code to draw the statusbars (add a pointer to viewportmanager-suitable statusbar values, which are the same for all screens), and re-arrange statusbar related code slightly. No functional change.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22514 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5174341999
commit
af967d77d3
4 changed files with 61 additions and 46 deletions
|
|
@ -129,6 +129,35 @@ bool skin_update(struct gui_wps *gwps, unsigned int update_type)
|
|||
return retval;
|
||||
}
|
||||
|
||||
void skin_statusbar_changed(struct gui_wps *skin)
|
||||
{
|
||||
if (!skin)
|
||||
return;
|
||||
struct wps_data *data = skin->data;
|
||||
const struct screen *display = skin->display;
|
||||
|
||||
struct viewport *vp = &find_viewport(VP_DEFAULT_LABEL, data)->vp;
|
||||
viewport_set_fullscreen(vp, display->screen_type);
|
||||
|
||||
if (data->wps_sb_tag)
|
||||
{ /* fix up the default viewport */
|
||||
if (data->show_sb_on_wps)
|
||||
{
|
||||
bool bar_at_top =
|
||||
statusbar_position(display->screen_type) != STATUSBAR_BOTTOM;
|
||||
|
||||
vp->y = bar_at_top?STATUSBAR_HEIGHT:0;
|
||||
vp->height = display->lcdheight - STATUSBAR_HEIGHT;
|
||||
}
|
||||
else
|
||||
{
|
||||
vp->y = 0;
|
||||
vp->height = display->lcdheight;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
||||
|
|
@ -1141,7 +1170,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
|
|||
|
||||
if (refresh_mode & WPS_REFRESH_STATUSBAR)
|
||||
{
|
||||
gwps_draw_statusbars();
|
||||
viewportmanager_set_statusbar(*gwps->statusbars);
|
||||
}
|
||||
/* Restore the default viewport */
|
||||
display->set_viewport(NULL);
|
||||
|
|
|
|||
|
|
@ -51,4 +51,7 @@ bool skin_data_load(struct wps_data *wps_data,
|
|||
|
||||
/* initial setup of wps_data */
|
||||
void skin_data_init(struct wps_data *wps_data);
|
||||
|
||||
/* call this in statusbar toggle handlers if needed */
|
||||
void skin_statusbar_changed(struct gui_wps*);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -286,10 +286,6 @@ struct wps_data
|
|||
unsigned int button_time_volume;
|
||||
};
|
||||
|
||||
|
||||
/* Redraw statusbars if necessary */
|
||||
void gwps_draw_statusbars(void);
|
||||
|
||||
/* Returns the index of the last subline's token in the token array.
|
||||
line - 0-based line number
|
||||
subline - 0-based subline number within the line
|
||||
|
|
@ -332,6 +328,12 @@ struct gui_wps
|
|||
struct screen *display;
|
||||
struct wps_data *data;
|
||||
struct wps_state *state;
|
||||
|
||||
/* suitable for the viewportmanager, possibly only temporary here
|
||||
* needs to be same for all screens! can't be split up for screens
|
||||
* due to what viewportmanager_set_statusbar() accepts
|
||||
* (FIXME?) */
|
||||
int *statusbars;
|
||||
};
|
||||
|
||||
/* gui_wps end */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue