forked from len0rd/rockbox
Fix the WPS to work properly with the statusbar for the previous change.. Side effect is it fixes FS#10721 where %pb didnt work
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23508 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a7d784b1d5
commit
c812614a1d
4 changed files with 16 additions and 20 deletions
|
|
@ -42,9 +42,8 @@ bool skin_update(struct gui_wps *gwps, unsigned int update_type);
|
|||
* setup up the skin-data from a format-buffer (isfile = false)
|
||||
* or from a skinfile (isfile = true)
|
||||
*/
|
||||
bool skin_data_load(struct wps_data *wps_data,
|
||||
const char *buf,
|
||||
bool isfile);
|
||||
bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
|
||||
const char *buf, bool isfile);
|
||||
|
||||
|
||||
/* initial setup of wps_data */
|
||||
|
|
|
|||
|
|
@ -64,6 +64,9 @@
|
|||
|
||||
#define WPS_ERROR_INVALID_PARAM -1
|
||||
|
||||
/* which screen are we parsing for? */
|
||||
static enum screen_type curr_screen;
|
||||
|
||||
/* level of current conditional.
|
||||
-1 means we're not in a conditional. */
|
||||
static int level = -1;
|
||||
|
|
@ -519,11 +522,7 @@ static int parse_statusbar_enable(const char *wps_bufptr,
|
|||
wps_data->wps_sb_tag = true;
|
||||
wps_data->show_sb_on_wps = true;
|
||||
struct skin_viewport *default_vp = find_viewport(VP_DEFAULT_LABEL, wps_data);
|
||||
if (default_vp->vp.y == 0)
|
||||
{
|
||||
default_vp->vp.y = STATUSBAR_HEIGHT;
|
||||
default_vp->vp.height -= STATUSBAR_HEIGHT;
|
||||
}
|
||||
viewport_set_defaults(&default_vp->vp, curr_screen);
|
||||
return skip_end_of_line(wps_bufptr);
|
||||
}
|
||||
|
||||
|
|
@ -535,11 +534,7 @@ static int parse_statusbar_disable(const char *wps_bufptr,
|
|||
wps_data->wps_sb_tag = true;
|
||||
wps_data->show_sb_on_wps = false;
|
||||
struct skin_viewport *default_vp = find_viewport(VP_DEFAULT_LABEL, wps_data);
|
||||
if (default_vp->vp.y == STATUSBAR_HEIGHT)
|
||||
{
|
||||
default_vp->vp.y = 0;
|
||||
default_vp->vp.height += STATUSBAR_HEIGHT;
|
||||
}
|
||||
viewport_set_fullscreen(&default_vp->vp, curr_screen);
|
||||
return skip_end_of_line(wps_bufptr);
|
||||
}
|
||||
|
||||
|
|
@ -1865,9 +1860,8 @@ static bool load_skin_bitmaps(struct wps_data *wps_data, char *bmpdir)
|
|||
|
||||
/* to setup up the wps-data from a format-buffer (isfile = false)
|
||||
from a (wps-)file (isfile = true)*/
|
||||
bool skin_data_load(struct wps_data *wps_data,
|
||||
const char *buf,
|
||||
bool isfile)
|
||||
bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
|
||||
const char *buf, bool isfile)
|
||||
{
|
||||
|
||||
if (!wps_data || !buf)
|
||||
|
|
@ -1886,6 +1880,7 @@ bool skin_data_load(struct wps_data *wps_data,
|
|||
#endif
|
||||
|
||||
skin_data_reset(wps_data);
|
||||
curr_screen = screen;
|
||||
|
||||
/* alloc default viewport, will be fixed up later */
|
||||
curr_vp = skin_buffer_alloc(sizeof(struct skin_viewport));
|
||||
|
|
@ -1903,6 +1898,8 @@ bool skin_data_load(struct wps_data *wps_data,
|
|||
curr_vp->hidden_flags = 0;
|
||||
curr_vp->lines = NULL;
|
||||
|
||||
viewport_set_defaults(&curr_vp->vp, screen);
|
||||
|
||||
curr_line = NULL;
|
||||
if (!skin_start_new_line(curr_vp, 0))
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ void sb_skin_data_load(enum screen_type screen, const char *buf, bool isfile)
|
|||
struct wps_data *data = sb_skin[screen].data;
|
||||
|
||||
int success;
|
||||
success = buf && skin_data_load(data, buf, isfile);
|
||||
success = buf && skin_data_load(screen, data, buf, isfile);
|
||||
|
||||
if (success)
|
||||
{ /* hide the sb's default viewport because it has nasty effect with stuff
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ void wps_data_load(enum screen_type screen, const char *buf, bool isfile)
|
|||
|
||||
#endif /* __PCTOOL__ */
|
||||
|
||||
loaded_ok = buf && skin_data_load(gui_wps[screen].data, buf, isfile);
|
||||
loaded_ok = buf && skin_data_load(screen, gui_wps[screen].data, buf, isfile);
|
||||
|
||||
if (!loaded_ok) /* load the hardcoded default */
|
||||
{
|
||||
|
|
@ -151,7 +151,7 @@ void wps_data_load(enum screen_type screen, const char *buf, bool isfile)
|
|||
"%pb\n",
|
||||
#endif
|
||||
};
|
||||
skin_data_load(gui_wps[screen].data, skin_buf[screen], false);
|
||||
skin_data_load(screen, gui_wps[screen].data, skin_buf[screen], false);
|
||||
}
|
||||
#ifdef HAVE_REMOVE_LCD
|
||||
gui_wps[screen].data->remote_wps = !(screen == SCREEN_MAIN);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue