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 | |
parent | f85e53f1149220f25c8be077b517ab3e3d5f7cd9 (diff) | |
download | rockbox-42e6638420ea1480532db72fb5f8766d1c6bed50.tar.gz rockbox-42e6638420ea1480532db72fb5f8766d1c6bed50.zip |
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
-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, | |||
112 | right_width = display->getstringsize(s, NULL, NULL); | 112 | right_width = display->getstringsize(s, NULL, NULL); |
113 | 113 | ||
114 | width = MAX(left_width, right_width); | 114 | width = MAX(left_width, right_width); |
115 | if (width*2 + vp_icons[screen].width > display->lcdwidth) | 115 | if (width*2 + vp_icons[screen].width > parent->width) |
116 | width = (display->lcdwidth - vp_icons[screen].width)/2; | 116 | { /* crop text viewports */ |
117 | else /* add more gap in icons vp */ | 117 | width = (parent->width - vp_icons[screen].width)/2; |
118 | { | 118 | } |
119 | int excess = display->lcdwidth - vp_icons[screen].width - width*2; | 119 | else |
120 | { /* add more gap in icons vp */ | ||
121 | int excess = parent->width - vp_icons[screen].width - width*2; | ||
120 | if (excess > MARGIN*4) | 122 | if (excess > MARGIN*4) |
121 | { | 123 | { |
122 | pad = MARGIN; | 124 | pad = MARGIN; |
@@ -315,7 +317,7 @@ static int quickscreen_touchscreen_button(void) | |||
315 | #endif | 317 | #endif |
316 | static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter) | 318 | static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter) |
317 | { | 319 | { |
318 | int button, i; | 320 | int button, i, j; |
319 | struct viewport vp[NB_SCREENS]; | 321 | struct viewport vp[NB_SCREENS]; |
320 | bool changed = false; | 322 | bool changed = false; |
321 | /* To quit we need either : | 323 | /* To quit we need either : |
@@ -367,6 +369,12 @@ static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_ente | |||
367 | } | 369 | } |
368 | /* Notify that we're exiting this screen */ | 370 | /* Notify that we're exiting this screen */ |
369 | cond_talk_ids_fq(VOICE_OK); | 371 | cond_talk_ids_fq(VOICE_OK); |
372 | FOR_NB_SCREENS(i) | ||
373 | { /* stop scrolling before exiting */ | ||
374 | for (j = 0; j < QUICKSCREEN_ITEM_COUNT; j++) | ||
375 | screens[i].scroll_stop(&vps[i][j]); | ||
376 | } | ||
377 | |||
370 | return changed; | 378 | return changed; |
371 | } | 379 | } |
372 | 380 | ||