diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2006-10-13 04:16:49 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2006-10-13 04:16:49 +0000 |
commit | 661c3406a928bad14102a09219774884f9e1db91 (patch) | |
tree | b232f67fe1000fc82c03d896fc949ef4d6f5d502 | |
parent | 65ef2dbb9417953179317b2f9254f67254da673c (diff) | |
download | rockbox-661c3406a928bad14102a09219774884f9e1db91.tar.gz rockbox-661c3406a928bad14102a09219774884f9e1db91.zip |
Added inner fill option to normal scrollbar and foreground only option. Added a left-pointing cursor for using pointer. Updated color picker and now sliders look very good on color, grayscale and mono screens when using bar selector. Some misc. changes for appearance.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11210 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/gui/color_picker.c | 132 | ||||
-rw-r--r-- | apps/gui/scrollbar.c | 134 | ||||
-rw-r--r-- | apps/gui/scrollbar.h | 15 | ||||
-rw-r--r-- | apps/recorder/icons.c | 17 | ||||
-rw-r--r-- | apps/recorder/icons.h | 3 |
5 files changed, 187 insertions, 114 deletions
diff --git a/apps/gui/color_picker.c b/apps/gui/color_picker.c index 719112df87..32b392c717 100644 --- a/apps/gui/color_picker.c +++ b/apps/gui/color_picker.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include "lang.h" | 31 | #include "lang.h" |
32 | #include "splash.h" | 32 | #include "splash.h" |
33 | #include "action.h" | 33 | #include "action.h" |
34 | #include "icons.h" | ||
34 | 35 | ||
35 | /* structure for color info */ | 36 | /* structure for color info */ |
36 | struct rgb_pick | 37 | struct rgb_pick |
@@ -51,20 +52,31 @@ struct rgb_pick | |||
51 | }; | 52 | }; |
52 | }; | 53 | }; |
53 | 54 | ||
54 | /* maximum values for components */ | ||
55 | static const unsigned char max_val[3] = | ||
56 | { | ||
57 | LCD_MAX_RED, | ||
58 | LCD_MAX_GREEN, | ||
59 | LCD_MAX_BLUE | ||
60 | }; | ||
61 | 55 | ||
62 | /* list of primary colors */ | 56 | /* list of primary colors */ |
63 | static const unsigned prim_rgb[3] = | 57 | #define SB_PRIM 0 |
58 | #define SB_FILL 1 | ||
59 | #define SB_MAX 2 | ||
60 | static const unsigned short prim_rgb[][3] = | ||
64 | { | 61 | { |
65 | LCD_RGBPACK(255, 0, 0), | 62 | /* Foreground colors for sliders */ |
66 | LCD_RGBPACK(0, 255, 0), | 63 | { |
67 | LCD_RGBPACK(0, 0 ,255), | 64 | LCD_RGBPACK(255, 0, 0), |
65 | LCD_RGBPACK( 0, 255, 0), | ||
66 | LCD_RGBPACK( 0, 0, 255), | ||
67 | }, | ||
68 | /* Fill colors for sliders */ | ||
69 | { | ||
70 | LCD_RGBPACK( 85, 0, 0), | ||
71 | LCD_RGBPACK( 0, 85, 0), | ||
72 | LCD_RGBPACK( 0, 0, 85), | ||
73 | }, | ||
74 | /* maximum values for components */ | ||
75 | { | ||
76 | LCD_MAX_RED, | ||
77 | LCD_MAX_GREEN, | ||
78 | LCD_MAX_BLUE | ||
79 | } | ||
68 | }; | 80 | }; |
69 | 81 | ||
70 | /* Unpacks the color value into native rgb values and 24 bit rgb values */ | 82 | /* Unpacks the color value into native rgb values and 24 bit rgb values */ |
@@ -98,20 +110,22 @@ static void pack_rgb(struct rgb_pick *rgb) | |||
98 | else return LCD_WHITE */ | 110 | else return LCD_WHITE */ |
99 | static inline unsigned get_black_or_white(const struct rgb_pick *rgb) | 111 | static inline unsigned get_black_or_white(const struct rgb_pick *rgb) |
100 | { | 112 | { |
101 | return (4*rgb->r + 5*rgb->g + 2*rgb->b) >= 256 ? | 113 | return (2*rgb->red + 5*rgb->green + rgb->blue) >= 1024 ? |
102 | LCD_BLACK : LCD_WHITE; | 114 | LCD_BLACK : LCD_WHITE; |
103 | } | 115 | } |
104 | 116 | ||
105 | #define MARGIN_LEFT 2 /* Left margin of screen */ | 117 | #define MARGIN_LEFT 0 /* Left margin of screen */ |
106 | #define MARGIN_TOP 4 /* Top margin of screen */ | 118 | #define MARGIN_TOP 2 /* Top margin of screen */ |
107 | #define MARGIN_RIGHT 2 /* Right margin of screen */ | 119 | #define MARGIN_RIGHT 0 /* Right margin of screen */ |
108 | #define MARGIN_BOTTOM 4 /* Bottom margin of screen */ | 120 | #define MARGIN_BOTTOM 6 /* Bottom margin of screen */ |
109 | #define SLIDER_MARGIN_LEFT 2 /* Gap to left of sliders */ | 121 | #define SLIDER_MARGIN_LEFT 2 /* Gap to left of sliders */ |
110 | #define SLIDER_MARGIN_RIGHT 2 /* Gap to right of sliders */ | 122 | #define SLIDER_MARGIN_RIGHT 2 /* Gap to right of sliders */ |
111 | #define TITLE_MARGIN_BOTTOM 4 /* Space below title bar */ | 123 | #define TITLE_MARGIN_BOTTOM 4 /* Space below title bar */ |
112 | #define SELECTOR_LR_MARGIN 1 /* Margin between ">" and text */ | 124 | #define SELECTOR_LR_MARGIN 0 /* Margin between ">" and text */ |
113 | #define SELECTOR_TB_MARGIN 1 /* Margin on top and bottom of selector */ | 125 | #define SELECTOR_TB_MARGIN 1 /* Margin on top and bottom of selector */ |
114 | #define SWATCH_TOP_MARGIN 4 /* Space between last slider and swatch */ | 126 | #define SWATCH_TOP_MARGIN 4 /* Space between last slider and swatch */ |
127 | #define SELECTOR_WIDTH 6 /* Width of > and < bitmaps */ | ||
128 | #define SELECTOR_HEIGHT 8 /* Height of > and < bitmaps */ | ||
115 | 129 | ||
116 | /* dunno why lcd_set_drawinfo should be left out of struct screen */ | 130 | /* dunno why lcd_set_drawinfo should be left out of struct screen */ |
117 | static void set_drawinfo(struct screen *display, int mode, | 131 | static void set_drawinfo(struct screen *display, int mode, |
@@ -173,19 +187,21 @@ static void draw_screen(struct screen *display, char *title, | |||
173 | 187 | ||
174 | /* Get slider positions and top starting position */ | 188 | /* Get slider positions and top starting position */ |
175 | text_top = MARGIN_TOP + y + TITLE_MARGIN_BOTTOM + SELECTOR_TB_MARGIN; | 189 | text_top = MARGIN_TOP + y + TITLE_MARGIN_BOTTOM + SELECTOR_TB_MARGIN; |
176 | slider_left = MARGIN_LEFT + SELECTOR_LR_MARGIN + display->char_width + | 190 | slider_left = MARGIN_LEFT + SELECTOR_WIDTH + SELECTOR_LR_MARGIN + |
177 | max_label_width + SLIDER_MARGIN_LEFT; | 191 | max_label_width + SLIDER_MARGIN_LEFT; |
178 | slider_width = display->width - slider_left - SLIDER_MARGIN_RIGHT - | 192 | slider_width = display->width - slider_left - SLIDER_MARGIN_RIGHT - |
179 | SELECTOR_LR_MARGIN - display->char_width*3 - MARGIN_RIGHT; | 193 | display->char_width*2 - SELECTOR_LR_MARGIN - SELECTOR_WIDTH - |
194 | MARGIN_RIGHT; | ||
180 | 195 | ||
181 | for (i = 0; i < 3; i++) | 196 | for (i = 0; i < 3; i++) |
182 | { | 197 | { |
183 | int mode = DRMODE_SOLID; | 198 | unsigned sb_flags = HORIZONTAL; |
184 | unsigned fg = text_color; | 199 | int mode = DRMODE_SOLID; |
185 | unsigned bg = background_color; | 200 | unsigned fg = text_color; |
201 | unsigned bg = background_color; | ||
186 | 202 | ||
187 | if (!display_three_rows) | 203 | if (!display_three_rows) |
188 | i = row; | 204 | i = row; |
189 | 205 | ||
190 | if (i == row) | 206 | if (i == row) |
191 | { | 207 | { |
@@ -201,39 +217,35 @@ static void draw_screen(struct screen *display, char *title, | |||
201 | display->char_height + | 217 | display->char_height + |
202 | SELECTOR_TB_MARGIN*2); | 218 | SELECTOR_TB_MARGIN*2); |
203 | 219 | ||
204 | if (display->depth == 1) | 220 | if (display->depth < 16) |
205 | { | ||
206 | /* Just invert for low mono display */ | ||
207 | mode |= DRMODE_INVERSEVID; | ||
208 | } | ||
209 | else | ||
210 | { | 221 | { |
211 | if (display->depth >= 16) | 222 | sb_flags |= FOREGROUND | INNER_FILL; |
212 | { | 223 | mode |= DRMODE_INVERSEVID; |
213 | /* Backdrops will show through text in | ||
214 | DRMODE_SOLID */ | ||
215 | mode = DRMODE_FG; | ||
216 | fg = prim_rgb[i]; | ||
217 | } | ||
218 | else | ||
219 | { | ||
220 | fg = background_color; | ||
221 | } | ||
222 | |||
223 | bg = text_color; | ||
224 | } | 224 | } |
225 | } | 225 | } |
226 | else if (display_three_rows) | 226 | else if (display_three_rows) |
227 | { | 227 | { |
228 | /* Draw "> <" around sliders */ | 228 | /* Draw "> <" around sliders */ |
229 | display->putsxy(MARGIN_LEFT, text_top, ">"); | 229 | int top = text_top + (display->char_height - |
230 | display->putsxy(display->width-display->char_width - | 230 | SELECTOR_HEIGHT) / 2; |
231 | MARGIN_RIGHT, text_top, "<"); | 231 | display->mono_bitmap(bitmap_icons_6x8[Icon_Cursor], |
232 | if (display->depth >= 16) | 232 | MARGIN_LEFT, top, |
233 | fg = prim_rgb[i]; | 233 | SELECTOR_WIDTH, SELECTOR_HEIGHT); |
234 | display->mono_bitmap(bitmap_icons_6x8[Icon_Reverse_Cursor], | ||
235 | display->width - MARGIN_RIGHT - | ||
236 | SELECTOR_WIDTH, top, SELECTOR_WIDTH, | ||
237 | SELECTOR_HEIGHT); | ||
238 | } | ||
239 | |||
240 | if (display->depth >= 16) | ||
241 | { | ||
242 | sb_flags |= FOREGROUND | INNER_BGFILL; | ||
243 | mode = DRMODE_FG; | ||
244 | fg = prim_rgb[SB_PRIM][i]; | ||
245 | bg = prim_rgb[SB_FILL][i]; | ||
234 | } | 246 | } |
235 | } | 247 | } |
236 | 248 | ||
237 | set_drawinfo(display, mode, fg, bg); | 249 | set_drawinfo(display, mode, fg, bg); |
238 | 250 | ||
239 | /* Draw label */ | 251 | /* Draw label */ |
@@ -253,17 +265,20 @@ static void draw_screen(struct screen *display, char *title, | |||
253 | text_top + display->char_height / 4, | 265 | text_top + display->char_height / 4, |
254 | slider_width, | 266 | slider_width, |
255 | display->char_height / 2, | 267 | display->char_height / 2, |
256 | max_val[i], | 268 | prim_rgb[SB_MAX][i], |
257 | 0, | 269 | 0, |
258 | rgb->rgb_val[i], | 270 | rgb->rgb_val[i], |
259 | HORIZONTAL); | 271 | sb_flags); |
260 | 272 | ||
261 | /* Advance to next line */ | 273 | /* Advance to next line */ |
262 | text_top += display->char_height + 2*SELECTOR_TB_MARGIN; | 274 | text_top += display->char_height + 2*SELECTOR_TB_MARGIN; |
263 | 275 | ||
264 | if (!display_three_rows) | 276 | if (!display_three_rows) |
265 | break; | 277 | break; |
266 | } | 278 | } /* end for */ |
279 | |||
280 | /* Draw color value in system font */ | ||
281 | display->setfont(FONT_SYSFIXED); | ||
267 | 282 | ||
268 | /* Format RGB: #rrggbb */ | 283 | /* Format RGB: #rrggbb */ |
269 | snprintf(buf, sizeof(buf), str(LANG_COLOR_RGB_VALUE), | 284 | snprintf(buf, sizeof(buf), str(LANG_COLOR_RGB_VALUE), |
@@ -272,13 +287,12 @@ static void draw_screen(struct screen *display, char *title, | |||
272 | if (display->depth >= 16) | 287 | if (display->depth >= 16) |
273 | { | 288 | { |
274 | /* Display color swatch on color screens only */ | 289 | /* Display color swatch on color screens only */ |
275 | int left = slider_left; | 290 | int left = MARGIN_LEFT + SELECTOR_WIDTH + SELECTOR_LR_MARGIN; |
276 | int top = text_top + SWATCH_TOP_MARGIN; | 291 | int top = text_top + SWATCH_TOP_MARGIN; |
277 | int width = display->width - slider_left - left; | 292 | int width = display->width - left - SELECTOR_LR_MARGIN - |
293 | SELECTOR_WIDTH - MARGIN_RIGHT; | ||
278 | int height = display->height - top - MARGIN_BOTTOM; | 294 | int height = display->height - top - MARGIN_BOTTOM; |
279 | 295 | ||
280 | display->setfont(FONT_SYSFIXED); | ||
281 | |||
282 | /* Only draw if room */ | 296 | /* Only draw if room */ |
283 | if (height >= display->char_height + 2) | 297 | if (height >= display->char_height + 2) |
284 | { | 298 | { |
@@ -298,10 +312,8 @@ static void draw_screen(struct screen *display, char *title, | |||
298 | 312 | ||
299 | /* Draw border */ | 313 | /* Draw border */ |
300 | display->set_foreground(text_color); | 314 | display->set_foreground(text_color); |
301 | display->drawrect(left - 1, top - 1, width + 2, height + 2); | 315 | display->drawrect(left, top, width, height); |
302 | } | 316 | } |
303 | |||
304 | display->setfont(FONT_UI); | ||
305 | } | 317 | } |
306 | else | 318 | else |
307 | { | 319 | { |
@@ -318,6 +330,8 @@ static void draw_screen(struct screen *display, char *title, | |||
318 | } | 330 | } |
319 | } | 331 | } |
320 | 332 | ||
333 | display->setfont(FONT_UI); | ||
334 | |||
321 | display->update(); | 335 | display->update(); |
322 | /* Be sure screen mode is reset */ | 336 | /* Be sure screen mode is reset */ |
323 | set_drawinfo(display, DRMODE_SOLID, text_color, background_color); | 337 | set_drawinfo(display, DRMODE_SOLID, text_color, background_color); |
@@ -363,7 +377,7 @@ bool set_color(struct screen *display, char *title, int* color, int banned_color | |||
363 | 377 | ||
364 | case ACTION_SETTINGS_INC: | 378 | case ACTION_SETTINGS_INC: |
365 | case ACTION_SETTINGS_INCREPEAT: | 379 | case ACTION_SETTINGS_INCREPEAT: |
366 | if (rgb.rgb_val[slider] < max_val[slider]) | 380 | if (rgb.rgb_val[slider] < prim_rgb[SB_MAX][slider]) |
367 | rgb.rgb_val[slider]++; | 381 | rgb.rgb_val[slider]++; |
368 | pack_rgb(&rgb); | 382 | pack_rgb(&rgb); |
369 | break; | 383 | break; |
diff --git a/apps/gui/scrollbar.c b/apps/gui/scrollbar.c index 4cf92f4b47..f7dead566e 100644 --- a/apps/gui/scrollbar.c +++ b/apps/gui/scrollbar.c | |||
@@ -26,27 +26,14 @@ | |||
26 | void gui_scrollbar_draw(struct screen * screen, int x, int y, | 26 | void gui_scrollbar_draw(struct screen * screen, int x, int y, |
27 | int width, int height, int items, | 27 | int width, int height, int items, |
28 | int min_shown, int max_shown, | 28 | int min_shown, int max_shown, |
29 | enum orientation orientation) | 29 | unsigned flags) |
30 | { | 30 | { |
31 | int min; | 31 | int inner_x, inner_y, inner_wd, inner_ht, inner_len; |
32 | int max; | 32 | int min, max, range; |
33 | int inner_len; | 33 | int start, size; |
34 | int start; | 34 | #ifdef HAVE_LCD_COLOR |
35 | int size; | 35 | int infill; |
36 | 36 | #endif | |
37 | /* draw box */ | ||
38 | screen->drawrect(x, y, width, height); | ||
39 | |||
40 | screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | ||
41 | |||
42 | /* clear edge pixels */ | ||
43 | screen->drawpixel(x, y); | ||
44 | screen->drawpixel((x + width - 1), y); | ||
45 | screen->drawpixel(x, (y + height - 1)); | ||
46 | screen->drawpixel((x + width - 1), (y + height - 1)); | ||
47 | |||
48 | /* clear pixels in progress bar */ | ||
49 | screen->fillrect(x + 1, y + 1, width - 2, height - 2); | ||
50 | 37 | ||
51 | /* min should be min */ | 38 | /* min should be min */ |
52 | if(min_shown < max_shown) { | 39 | if(min_shown < max_shown) { |
@@ -69,10 +56,17 @@ void gui_scrollbar_draw(struct screen * screen, int x, int y, | |||
69 | if(max > items) | 56 | if(max > items) |
70 | max = items; | 57 | max = items; |
71 | 58 | ||
72 | if (orientation == VERTICAL) | 59 | range = max - min; |
73 | inner_len = height - 2; | 60 | |
61 | inner_x = x + 1; | ||
62 | inner_y = y + 1; | ||
63 | inner_wd = width - 2; | ||
64 | inner_ht = height - 2; | ||
65 | |||
66 | if (flags & HORIZONTAL) | ||
67 | inner_len = inner_wd; | ||
74 | else | 68 | else |
75 | inner_len = width - 2; | 69 | inner_len = inner_ht; |
76 | 70 | ||
77 | /* avoid overflows */ | 71 | /* avoid overflows */ |
78 | while (items > (INT_MAX / inner_len)) { | 72 | while (items > (INT_MAX / inner_len)) { |
@@ -82,31 +76,87 @@ void gui_scrollbar_draw(struct screen * screen, int x, int y, | |||
82 | } | 76 | } |
83 | 77 | ||
84 | /* calc start and end of the knob */ | 78 | /* calc start and end of the knob */ |
85 | if (items > 0 && items > (max - min)) { | 79 | if (items > 0 && items > range) { |
86 | size = inner_len * (max - min) / items; | 80 | size = inner_len * range / items; |
87 | if (size == 0) { /* width of knob is null */ | 81 | if (size == 0) { /* width of knob is null */ |
88 | size = 1; | 82 | size = 1; |
89 | start = (inner_len - 1) * min / items; | 83 | start = (inner_len - 1) * min / items; |
90 | } else { | 84 | } else { |
91 | start = (inner_len - size) * min / (items - (max - min)); | 85 | start = (inner_len - size) * min / (items - range); |
92 | } | 86 | } |
93 | } else { /* if null draw full bar */ | 87 | } else { /* if null draw full bar */ |
94 | size = inner_len; | 88 | size = inner_len; |
95 | start = 0; | 89 | start = 0; |
96 | } | 90 | } |
97 | 91 | ||
92 | /* draw box */ | ||
93 | #ifdef HAVE_LCD_COLOR | ||
94 | /* must avoid corners if case of (flags & FOREGROUND) */ | ||
95 | screen->hline(inner_x, x + inner_wd, y); | ||
96 | screen->hline(inner_x, x + inner_wd, y + height - 1); | ||
97 | screen->vline(x, inner_y, y + inner_ht); | ||
98 | screen->vline(x + width - 1, inner_y, y + inner_ht); | ||
99 | #else | ||
100 | screen->drawrect(x, y, width, height); | ||
101 | #endif | ||
102 | |||
103 | screen->set_drawmode(DRMODE_SOLID | DRMODE_INVERSEVID); | ||
104 | |||
105 | #ifdef HAVE_LCD_COLOR | ||
106 | infill = flags & (screen->depth > 1 ? INNER_FILL_MASK : INNER_FILL); | ||
107 | |||
108 | if (!(flags & FOREGROUND)) | ||
109 | { | ||
110 | #endif | ||
111 | /* clear corner pixels */ | ||
112 | screen->drawpixel(x, y); | ||
113 | screen->drawpixel(x + width - 1, y); | ||
114 | screen->drawpixel(x, y + height - 1); | ||
115 | screen->drawpixel(x + width - 1, y + height - 1); | ||
116 | |||
117 | #ifdef HAVE_LCD_COLOR | ||
118 | if (infill != INNER_BGFILL) | ||
119 | infill = INNER_FILL; | ||
120 | } | ||
121 | |||
122 | if (infill == INNER_FILL) | ||
123 | #endif | ||
124 | { | ||
125 | /* clear pixels in progress bar */ | ||
126 | screen->fillrect(inner_x, inner_y, inner_wd, inner_ht); | ||
127 | } | ||
128 | |||
98 | screen->set_drawmode(DRMODE_SOLID); | 129 | screen->set_drawmode(DRMODE_SOLID); |
99 | 130 | ||
100 | if(orientation == VERTICAL) | 131 | #ifdef HAVE_LCD_COLOR |
101 | screen->fillrect(x + 1, y + start + 1, width - 2, size); | 132 | if (infill == INNER_BGFILL) |
133 | { | ||
134 | /* fill inner area with current background color */ | ||
135 | unsigned fg = screen->get_foreground(); | ||
136 | screen->set_foreground(screen->get_background()); | ||
137 | screen->fillrect(inner_x, inner_y, inner_wd, inner_ht); | ||
138 | screen->set_foreground(fg); | ||
139 | } | ||
140 | #endif | ||
141 | |||
142 | if (flags & HORIZONTAL) | ||
143 | { | ||
144 | inner_x += start; | ||
145 | inner_wd = size; | ||
146 | } | ||
102 | else | 147 | else |
103 | screen->fillrect(x + start + 1, y + 1, size, height - 2); | 148 | { |
149 | inner_y += start; | ||
150 | inner_ht = size; | ||
151 | } | ||
152 | |||
153 | screen->fillrect(inner_x, inner_y, inner_wd, inner_ht); | ||
104 | } | 154 | } |
105 | 155 | ||
106 | void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x, int y, | 156 | void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x, int y, |
107 | int width, int height, int items, | 157 | int width, int height, int items, |
108 | int min_shown, int max_shown, | 158 | int min_shown, int max_shown, |
109 | enum orientation orientation) | 159 | unsigned flags) |
110 | { | 160 | { |
111 | int min; | 161 | int min; |
112 | int max; | 162 | int max; |
@@ -140,7 +190,7 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x, | |||
140 | if(max > items) | 190 | if(max > items) |
141 | max = items; | 191 | max = items; |
142 | 192 | ||
143 | if (orientation == VERTICAL) | 193 | if (flags & VERTICAL) |
144 | inner_len = height; | 194 | inner_len = height; |
145 | else | 195 | else |
146 | inner_len = width; | 196 | inner_len = width; |
@@ -168,27 +218,27 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x, | |||
168 | 218 | ||
169 | screen->set_drawmode(DRMODE_SOLID); | 219 | screen->set_drawmode(DRMODE_SOLID); |
170 | 220 | ||
171 | if(orientation == VERTICAL) { | 221 | if (flags & HORIZONTAL) { |
172 | #if LCD_DEPTH > 1 | 222 | #if LCD_DEPTH > 1 |
173 | if (bm.format == FORMAT_MONO) | 223 | if (bm.format == FORMAT_MONO) |
174 | #endif | 224 | #endif |
175 | screen->mono_bitmap_part(bm.data, 0, 0, | 225 | screen->mono_bitmap_part(bm.data, 0, 0, |
176 | bm.width, x, y + start, width, size); | 226 | bm.width, x + start, y, size, height); |
177 | #if LCD_DEPTH > 1 | 227 | #if LCD_DEPTH > 1 |
178 | else | 228 | else |
179 | screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0, | 229 | screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0, |
180 | bm.width, x, y + start, width, size); | 230 | bm.width, x + start, y, size, height); |
181 | #endif | 231 | #endif |
182 | } else { | 232 | } else { |
183 | #if LCD_DEPTH > 1 | 233 | #if LCD_DEPTH > 1 |
184 | if (bm.format == FORMAT_MONO) | 234 | if (bm.format == FORMAT_MONO) |
185 | #endif | 235 | #endif |
186 | screen->mono_bitmap_part(bm.data, 0, 0, | 236 | screen->mono_bitmap_part(bm.data, 0, 0, |
187 | bm.width, x + start, y, size, height); | 237 | bm.width, x, y + start, width, size); |
188 | #if LCD_DEPTH > 1 | 238 | #if LCD_DEPTH > 1 |
189 | else | 239 | else |
190 | screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0, | 240 | screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0, |
191 | bm.width, x + start, y, size, height); | 241 | bm.width, x, y + start, width, size); |
192 | #endif | 242 | #endif |
193 | } | 243 | } |
194 | } | 244 | } |
diff --git a/apps/gui/scrollbar.h b/apps/gui/scrollbar.h index 541cc2d4df..40279a1a9d 100644 --- a/apps/gui/scrollbar.h +++ b/apps/gui/scrollbar.h | |||
@@ -24,8 +24,15 @@ | |||
24 | #ifdef HAVE_LCD_BITMAP | 24 | #ifdef HAVE_LCD_BITMAP |
25 | 25 | ||
26 | enum orientation { | 26 | enum orientation { |
27 | VERTICAL, | 27 | VERTICAL = 0x0000, /* Vertical orientation */ |
28 | HORIZONTAL | 28 | HORIZONTAL = 0x0001, /* Horizontal orientation */ |
29 | #ifdef HAVE_LCD_COLOR | ||
30 | FOREGROUND = 0x0002, /* Do not clear background pixels */ | ||
31 | INNER_FILL = 0x0004, /* Fill inner part even if FOREGROUND */ | ||
32 | INNER_BGFILL = 0x0008, /* Fill inner part with background | ||
33 | color even if FOREGROUND */ | ||
34 | INNER_FILL_MASK = 0x000c, | ||
35 | #endif | ||
29 | }; | 36 | }; |
30 | 37 | ||
31 | /* | 38 | /* |
@@ -43,10 +50,10 @@ enum orientation { | |||
43 | extern void gui_scrollbar_draw(struct screen * screen, int x, int y, | 50 | extern void gui_scrollbar_draw(struct screen * screen, int x, int y, |
44 | int width, int height, int items, | 51 | int width, int height, int items, |
45 | int min_shown, int max_shown, | 52 | int min_shown, int max_shown, |
46 | enum orientation orientation); | 53 | unsigned flags); |
47 | extern void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x, int y, | 54 | extern void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x, int y, |
48 | int width, int height, int items, | 55 | int width, int height, int items, |
49 | int min_shown, int max_shown, | 56 | int min_shown, int max_shown, |
50 | enum orientation orientation); | 57 | unsigned flags); |
51 | #endif /* HAVE_LCD_BITMAP */ | 58 | #endif /* HAVE_LCD_BITMAP */ |
52 | #endif /* _GUI_SCROLLBAR_H_ */ | 59 | #endif /* _GUI_SCROLLBAR_H_ */ |
diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index 9433694cb9..46d628e780 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c | |||
@@ -56,6 +56,7 @@ const unsigned char bitmap_icons_6x8[][6] = | |||
56 | { 0x77, 0x55, 0x55, 0x55, 0x55, 0x77 }, /* Queued Item */ | 56 | { 0x77, 0x55, 0x55, 0x55, 0x55, 0x77 }, /* Queued Item */ |
57 | { 0x3e, 0x41, 0x3e, 0x1c, 0x1c, 0x08 }, /* Moving Item */ | 57 | { 0x3e, 0x41, 0x3e, 0x1c, 0x1c, 0x08 }, /* Moving Item */ |
58 | { 0x7f, 0x7f, 0x1c, 0x3e, 0x77, 0x63 }, /* Keyboard file */ | 58 | { 0x7f, 0x7f, 0x1c, 0x3e, 0x77, 0x63 }, /* Keyboard file */ |
59 | { 0x00, 0x00, 0x00, 0x08, 0x1c, 0x3e }, /* Reverse Cursor / Marker */ | ||
59 | }; | 60 | }; |
60 | 61 | ||
61 | const unsigned char bitmap_icons_7x8[][7] = | 62 | const unsigned char bitmap_icons_7x8[][7] = |
@@ -85,21 +86,21 @@ const unsigned char bitmap_icons_18x8[][18] = | |||
85 | { | 86 | { |
86 | {0x00, 0x00, 0x00, 0x00,0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x3e, 0x2a, | 87 | {0x00, 0x00, 0x00, 0x00,0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x3e, 0x2a, |
87 | 0x3a, 0x00, 0x0e, 0x08, 0x3e, 0x00}, /* mp3 64kbps */ | 88 | 0x3a, 0x00, 0x0e, 0x08, 0x3e, 0x00}, /* mp3 64kbps */ |
88 | {0x00, 0x00, 0x00, 0x00,0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x0e, 0x0a, | 89 | {0x00, 0x00, 0x00, 0x00,0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x0e, 0x0a, |
89 | 0x3e, 0x00, 0x3e, 0x2a, 0x3a, 0x00}, /* mp3 96kbps */ | 90 | 0x3e, 0x00, 0x3e, 0x2a, 0x3a, 0x00}, /* mp3 96kbps */ |
90 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3a, 0x2a, | 91 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3a, 0x2a, |
91 | 0x2e, 0x00, 0x3e, 0x2a, 0x3e, 0x00}, /* mp3 128kbps */ | 92 | 0x2e, 0x00, 0x3e, 0x2a, 0x3e, 0x00}, /* mp3 128kbps */ |
92 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3e, 0x2a, | 93 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3e, 0x2a, |
93 | 0x3a, 0x00, 0x3e, 0x22, 0x3e, 0x00}, /* mp3 160kbps */ | 94 | 0x3a, 0x00, 0x3e, 0x22, 0x3e, 0x00}, /* mp3 160kbps */ |
94 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x0e, 0x0a, | 95 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x0e, 0x0a, |
95 | 0x3e, 0x00, 0x3a, 0x2a, 0x2e, 0x00}, /* mp3 192kbps */ | 96 | 0x3e, 0x00, 0x3a, 0x2a, 0x2e, 0x00}, /* mp3 192kbps */ |
96 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3a, 0x2a, | 97 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3a, 0x2a, |
97 | 0x2e, 0x00, 0x0e, 0x08, 0x3e, 0x00}, /* mp3 224kbps */ | 98 | 0x2e, 0x00, 0x0e, 0x08, 0x3e, 0x00}, /* mp3 224kbps */ |
98 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x22, 0x2a, 0x36, 0x00, 0x3a, 0x2a, | 99 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x22, 0x2a, 0x36, 0x00, 0x3a, 0x2a, |
99 | 0x2e, 0x00, 0x3e, 0x22, 0x3e, 0x00}, /* mp3 320kbps */ | 100 | 0x2e, 0x00, 0x3e, 0x22, 0x3e, 0x00}, /* mp3 320kbps */ |
100 | {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x1e, 0x20, 0x18, 0x20, 0x1e, | 101 | {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x1e, 0x20, 0x18, 0x20, 0x1e, |
101 | 0x00, 0x1e, 0x20, 0x18, 0x06, 0x00}, /* wv */ | 102 | 0x00, 0x1e, 0x20, 0x18, 0x06, 0x00}, /* wv */ |
102 | {0x00, 0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x12, 0x12, 0x3c, | 103 | {0x00, 0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x12, 0x12, 0x3c, |
103 | 0x00, 0x1e, 0x20, 0x18, 0x06, 0x00} /* wav */ | 104 | 0x00, 0x1e, 0x20, 0x18, 0x06, 0x00} /* wav */ |
104 | }; | 105 | }; |
105 | 106 | ||
diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h index 826f18b123..75401f6f0b 100644 --- a/apps/recorder/icons.h +++ b/apps/recorder/icons.h | |||
@@ -63,7 +63,8 @@ enum icons_6x8 { | |||
63 | Icon_Queued, | 63 | Icon_Queued, |
64 | Icon_Moving, | 64 | Icon_Moving, |
65 | Icon_Keyboard, | 65 | Icon_Keyboard, |
66 | Icon6x8Last | 66 | Icon_Reverse_Cursor, |
67 | Icon6x8Last, | ||
67 | }; | 68 | }; |
68 | 69 | ||
69 | enum icons_7x8 { | 70 | enum icons_7x8 { |