diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2009-01-05 07:50:25 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2009-01-05 07:50:25 +0000 |
commit | e74cc6d9da7c7eab96cb06147903c75c1f9c06c7 (patch) | |
tree | e90b70fc18a27372a28e8ca012de9c09439c5656 /apps/gui | |
parent | 6920a5be449b258ebbde6e709607dddb00511a6b (diff) | |
download | rockbox-e74cc6d9da7c7eab96cb06147903c75c1f9c06c7.tar.gz rockbox-e74cc6d9da7c7eab96cb06147903c75c1f9c06c7.zip |
"fix" FS#9757 by handing the statusbar redraw event more correctly... the eqscreen needs to be converted to viewports to display the statusbar.
fix the colour chooser screen to work with the bar redraw also
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19680 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/color_picker.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/apps/gui/color_picker.c b/apps/gui/color_picker.c index d344317c5e..827be69460 100644 --- a/apps/gui/color_picker.c +++ b/apps/gui/color_picker.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include "action.h" | 35 | #include "action.h" |
36 | #include "icon.h" | 36 | #include "icon.h" |
37 | #include "color_picker.h" | 37 | #include "color_picker.h" |
38 | #include "viewport.h" | ||
38 | 39 | ||
39 | /* structure for color info */ | 40 | /* structure for color info */ |
40 | struct rgb_pick | 41 | struct rgb_pick |
@@ -145,6 +146,10 @@ static void draw_screen(struct screen *display, char *title, | |||
145 | int slider_left, slider_width; | 146 | int slider_left, slider_width; |
146 | bool display_three_rows; | 147 | bool display_three_rows; |
147 | int max_label_width; | 148 | int max_label_width; |
149 | struct viewport vp; | ||
150 | |||
151 | viewport_set_defaults(&vp, display->screen_type); | ||
152 | display->set_viewport(&vp); | ||
148 | 153 | ||
149 | display->clear_display(); | 154 | display->clear_display(); |
150 | 155 | ||
@@ -158,7 +163,7 @@ static void draw_screen(struct screen *display, char *title, | |||
158 | enough to display the selected slider - calculate total height | 163 | enough to display the selected slider - calculate total height |
159 | of display with three sliders present */ | 164 | of display with three sliders present */ |
160 | display_three_rows = | 165 | display_three_rows = |
161 | display->getheight() >= | 166 | vp.height >= |
162 | MARGIN_TOP + | 167 | MARGIN_TOP + |
163 | display->getcharheight()*4 + /* Title + 3 sliders */ | 168 | display->getcharheight()*4 + /* Title + 3 sliders */ |
164 | TITLE_MARGIN_BOTTOM + | 169 | TITLE_MARGIN_BOTTOM + |
@@ -179,13 +184,13 @@ static void draw_screen(struct screen *display, char *title, | |||
179 | /* Draw title string */ | 184 | /* Draw title string */ |
180 | set_drawinfo(display, DRMODE_SOLID, text_color, background_color); | 185 | set_drawinfo(display, DRMODE_SOLID, text_color, background_color); |
181 | display->getstringsize(title, &x, &y); | 186 | display->getstringsize(title, &x, &y); |
182 | display->putsxy((display->getwidth() - x) / 2, MARGIN_TOP, title); | 187 | display->putsxy((vp.width - x) / 2, MARGIN_TOP, title); |
183 | 188 | ||
184 | /* Get slider positions and top starting position */ | 189 | /* Get slider positions and top starting position */ |
185 | text_top = MARGIN_TOP + y + TITLE_MARGIN_BOTTOM + SELECTOR_TB_MARGIN; | 190 | text_top = MARGIN_TOP + y + TITLE_MARGIN_BOTTOM + SELECTOR_TB_MARGIN; |
186 | slider_left = MARGIN_LEFT + SELECTOR_WIDTH + SELECTOR_LR_MARGIN + | 191 | slider_left = MARGIN_LEFT + SELECTOR_WIDTH + SELECTOR_LR_MARGIN + |
187 | max_label_width + SLIDER_MARGIN_LEFT; | 192 | max_label_width + SLIDER_MARGIN_LEFT; |
188 | slider_width = display->getwidth() - slider_left - SLIDER_MARGIN_RIGHT - | 193 | slider_width = vp.width - slider_left - SLIDER_MARGIN_RIGHT - |
189 | display->getcharwidth()*2 - SELECTOR_LR_MARGIN - | 194 | display->getcharwidth()*2 - SELECTOR_LR_MARGIN - |
190 | SELECTOR_WIDTH - MARGIN_RIGHT; | 195 | SELECTOR_WIDTH - MARGIN_RIGHT; |
191 | 196 | ||
@@ -209,7 +214,7 @@ static void draw_screen(struct screen *display, char *title, | |||
209 | /* Draw solid bar selection bar */ | 214 | /* Draw solid bar selection bar */ |
210 | display->fillrect(0, | 215 | display->fillrect(0, |
211 | text_top - SELECTOR_TB_MARGIN, | 216 | text_top - SELECTOR_TB_MARGIN, |
212 | display->getwidth(), | 217 | vp.width, |
213 | display->getcharheight() + | 218 | display->getcharheight() + |
214 | SELECTOR_TB_MARGIN*2); | 219 | SELECTOR_TB_MARGIN*2); |
215 | 220 | ||
@@ -226,7 +231,7 @@ static void draw_screen(struct screen *display, char *title, | |||
226 | SELECTOR_HEIGHT) / 2; | 231 | SELECTOR_HEIGHT) / 2; |
227 | screen_put_iconxy(display, MARGIN_LEFT, top, Icon_Cursor); | 232 | screen_put_iconxy(display, MARGIN_LEFT, top, Icon_Cursor); |
228 | screen_put_iconxy(display, | 233 | screen_put_iconxy(display, |
229 | display->getwidth() - MARGIN_RIGHT - | 234 | vp.width - MARGIN_RIGHT - |
230 | get_icon_width(display->screen_type), | 235 | get_icon_width(display->screen_type), |
231 | top, Icon_Cursor); | 236 | top, Icon_Cursor); |
232 | } | 237 | } |
@@ -280,9 +285,9 @@ static void draw_screen(struct screen *display, char *title, | |||
280 | /* Display color swatch on color screens only */ | 285 | /* Display color swatch on color screens only */ |
281 | int left = MARGIN_LEFT + SELECTOR_WIDTH + SELECTOR_LR_MARGIN; | 286 | int left = MARGIN_LEFT + SELECTOR_WIDTH + SELECTOR_LR_MARGIN; |
282 | int top = text_top + SWATCH_TOP_MARGIN; | 287 | int top = text_top + SWATCH_TOP_MARGIN; |
283 | int width = display->getwidth() - left - SELECTOR_LR_MARGIN - | 288 | int width = vp.width - left - SELECTOR_LR_MARGIN - |
284 | SELECTOR_WIDTH - MARGIN_RIGHT; | 289 | SELECTOR_WIDTH - MARGIN_RIGHT; |
285 | int height = display->getheight() - top - MARGIN_BOTTOM; | 290 | int height = vp.height - top - MARGIN_BOTTOM; |
286 | 291 | ||
287 | /* Only draw if room */ | 292 | /* Only draw if room */ |
288 | if (height >= display->getcharheight() + 2) | 293 | if (height >= display->getcharheight() + 2) |
@@ -315,15 +320,16 @@ static void draw_screen(struct screen *display, char *title, | |||
315 | if (i + y <= display->getheight() - MARGIN_BOTTOM) | 320 | if (i + y <= display->getheight() - MARGIN_BOTTOM) |
316 | { | 321 | { |
317 | set_drawinfo(display, DRMODE_SOLID, text_color, background_color); | 322 | set_drawinfo(display, DRMODE_SOLID, text_color, background_color); |
318 | x = (display->getwidth() - x) / 2; | 323 | x = (vp.width - x) / 2; |
319 | y = (i + display->getheight() - MARGIN_BOTTOM - y) / 2; | 324 | y = (i + vp.height - MARGIN_BOTTOM - y) / 2; |
320 | display->putsxy(x, y, buf); | 325 | display->putsxy(x, y, buf); |
321 | } | 326 | } |
322 | } | 327 | } |
323 | 328 | ||
324 | display->setfont(FONT_UI); | 329 | display->setfont(FONT_UI); |
325 | 330 | ||
326 | display->update(); | 331 | display->update_viewport(); |
332 | display->set_viewport(NULL); | ||
327 | /* Be sure screen mode is reset */ | 333 | /* Be sure screen mode is reset */ |
328 | set_drawinfo(display, DRMODE_SOLID, text_color, background_color); | 334 | set_drawinfo(display, DRMODE_SOLID, text_color, background_color); |
329 | } | 335 | } |