From 42e6638420ea1480532db72fb5f8766d1c6bed50 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sat, 5 Sep 2009 14:38:29 +0000 Subject: Fix bug in viewports preparation (screen.lcdwidth() isn't really proper for this in times of custom ui vp), and stop all scrolling before exiting (fixes FS#10584). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22631 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/quickscreen.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'apps/gui/quickscreen.c') diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c index 58b1fa45e7..7b042aa078 100644 --- a/apps/gui/quickscreen.c +++ b/apps/gui/quickscreen.c @@ -112,11 +112,13 @@ static void quickscreen_fix_viewports(struct gui_quickscreen *qs, right_width = display->getstringsize(s, NULL, NULL); width = MAX(left_width, right_width); - if (width*2 + vp_icons[screen].width > display->lcdwidth) - width = (display->lcdwidth - vp_icons[screen].width)/2; - else /* add more gap in icons vp */ - { - int excess = display->lcdwidth - vp_icons[screen].width - width*2; + if (width*2 + vp_icons[screen].width > parent->width) + { /* crop text viewports */ + width = (parent->width - vp_icons[screen].width)/2; + } + else + { /* add more gap in icons vp */ + int excess = parent->width - vp_icons[screen].width - width*2; if (excess > MARGIN*4) { pad = MARGIN; @@ -315,7 +317,7 @@ static int quickscreen_touchscreen_button(void) #endif static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter) { - int button, i; + int button, i, j; struct viewport vp[NB_SCREENS]; bool changed = false; /* To quit we need either : @@ -367,6 +369,12 @@ static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_ente } /* Notify that we're exiting this screen */ cond_talk_ids_fq(VOICE_OK); + FOR_NB_SCREENS(i) + { /* stop scrolling before exiting */ + for (j = 0; j < QUICKSCREEN_ITEM_COUNT; j++) + screens[i].scroll_stop(&vps[i][j]); + } + return changed; } -- cgit v1.2.3