diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-09-05 14:38:29 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-09-05 14:38:29 +0000 |
commit | 42e6638420ea1480532db72fb5f8766d1c6bed50 (patch) | |
tree | 1bb8890175df56075923653ff20a4ba52d520efd /apps/gui | |
parent | f85e53f1149220f25c8be077b517ab3e3d5f7cd9 (diff) |
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
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/quickscreen.c | 20 |
1 files changed, 14 insertions, 6 deletions
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; } |