From bdbdb97f19655a635a2d37f81f9fe1e31f9162b2 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 23 Jun 2008 13:20:35 +0000 Subject: FS#9051 - remove LCD margins... use viewports if you need them... NOTE to WPS people.... %m has been removed, but (i think) because of the other %m tags it wont fail if you try loading a wps with %m|..|, it will just be ignored. Also note that if the statusbar is enabled the default viewport is 8 pixels shorter than when its not, i.e (0,0) is really (0,8) if the statusbar is shown... I dont think this will be a major issue because almost no WPS show the bar and use bitmaps... text only WPS shouldnt be affected. Please report problem screens in http://forums.rockbox.org/index.php?topic=17358.0 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17763 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/gwps-common.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'apps/gui/gwps-common.c') diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 6e159b88b4..b53d68d6ba 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c @@ -345,7 +345,6 @@ bool gui_wps_display(void) /* Update the values in the first (default) viewport - in case the user has modified the statusbar or colour settings */ #ifdef HAVE_LCD_BITMAP - gui_wps[i].data->viewports[0].vp.ymargin = gui_wps[i].display->getymargin(); #if LCD_DEPTH > 1 if (gui_wps[i].display->depth > 1) { @@ -1408,14 +1407,6 @@ static char *get_token_value(struct gui_wps *gwps, else return NULL; #endif - -#ifdef HAVE_LCD_BITMAP - case WPS_TOKEN_LEFTMARGIN: - gwps->display->setmargins(token->value.i, - gwps->display->getymargin()); - return NULL; -#endif - default: return NULL; } @@ -1529,11 +1520,6 @@ static bool get_line(struct gui_wps *gwps, align->center = NULL; align->right = NULL; -#ifdef HAVE_LCD_BITMAP - /* Reset margins - only bitmap targets modify them */ - gwps->display->setmargins(0, gwps->display->getymargin()); -#endif - /* Process all tokens of the desired subline */ last_token_idx = wps_last_token_index(data, line, subline); for (i = wps_first_token_index(data, line, subline); @@ -1800,7 +1786,7 @@ static void write_line(struct screen *display, ¢er_width, &string_height); } - left_xpos = display->getxmargin(); + left_xpos = 0; right_xpos = (display->getwidth() - right_width); center_xpos = (display->getwidth() + left_xpos - center_width) / 2; @@ -1885,7 +1871,7 @@ static void write_line(struct screen *display, right_width = 0; } - ypos = (line * string_height) + display->getymargin(); + ypos = (line * string_height); if (scroll && ((left_width > scroll_width) || @@ -1968,7 +1954,8 @@ bool gui_wps_refresh(struct gui_wps *gwps, /* reset to first subline if refresh all flag is set */ if (refresh_mode == WPS_REFRESH_ALL) { - display->clear_display(); + display->set_viewport(&data->viewports[0].vp); + display->clear_viewport(); for (i = 0; i <= data->num_lines; i++) { @@ -2063,7 +2050,7 @@ bool gui_wps_refresh(struct gui_wps *gwps, update_line = false; int h = font_get(data->viewports[v].vp.font)->height; - int peak_meter_y = display->getymargin() + (line - data->viewports[v].first_line)* h; + int peak_meter_y = (line - data->viewports[v].first_line)* h; /* The user might decide to have the peak meter in the last line so that it is only displayed if no status bar is -- cgit v1.2.3