summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/bitmap/list.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index ff95f6b2f7..47ecc1b9ca 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -67,6 +67,7 @@ bool list_display_title(struct gui_synclist *list, enum screen_type screen);
67static bool draw_title(struct screen *display, struct gui_synclist *list) 67static bool draw_title(struct screen *display, struct gui_synclist *list)
68{ 68{
69 const int screen = display->screen_type; 69 const int screen = display->screen_type;
70 int style = STYLE_DEFAULT;
70 if (!list_display_title(list, screen)) 71 if (!list_display_title(list, screen))
71 return false; 72 return false;
72 title_text[screen] = *(list->parent[screen]); 73 title_text[screen] = *(list->parent[screen]);
@@ -85,24 +86,21 @@ static bool draw_title(struct screen *display, struct gui_synclist *list)
85 display->set_viewport(&title_icon); 86 display->set_viewport(&title_icon);
86 screen_put_icon(display, 0, 0, list->title_icon); 87 screen_put_icon(display, 0, 0, list->title_icon);
87 } 88 }
88 title_text[screen].drawmode = STYLE_DEFAULT;
89#ifdef HAVE_LCD_COLOR 89#ifdef HAVE_LCD_COLOR
90 if (list->title_color >= 0) 90 if (list->title_color >= 0)
91 { 91 {
92 title_text[screen].drawmode 92 style |= (STYLE_COLORED|list->title_color);
93 |= (STYLE_COLORED|list->title_color);
94 } 93 }
95#endif 94#endif
96 display->set_viewport(&title_text[screen]); 95 display->set_viewport(&title_text[screen]);
97 display->puts_scroll_style(0, 0, list->title, 96 display->puts_scroll_style(0, 0, list->title, style);
98 title_text[screen].drawmode);
99 return true; 97 return true;
100} 98}
101 99
102void list_draw(struct screen *display, struct gui_synclist *list) 100void list_draw(struct screen *display, struct gui_synclist *list)
103{ 101{
104 struct viewport list_icons; 102 struct viewport list_icons;
105 int start, end, line_height, i; 103 int start, end, line_height, style, i;
106 const int screen = display->screen_type; 104 const int screen = display->screen_type;
107 const int icon_width = get_icon_width(screen) + ICON_PADDING; 105 const int icon_width = get_icon_width(screen) + ICON_PADDING;
108 const bool show_cursor = !global_settings.cursor_style && 106 const bool show_cursor = !global_settings.cursor_style &&
@@ -179,7 +177,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
179 sizeof(entry_buffer)); 177 sizeof(entry_buffer));
180 entry_name = P2STR(s); 178 entry_name = P2STR(s);
181 display->set_viewport(&list_text[screen]); 179 display->set_viewport(&list_text[screen]);
182 list_text[screen].drawmode = STYLE_DEFAULT; 180 style = STYLE_DEFAULT;
183 /* position the string at the correct offset place */ 181 /* position the string at the correct offset place */
184 int item_width,h; 182 int item_width,h;
185 display->getstringsize(entry_name, &item_width, &h); 183 display->getstringsize(entry_name, &item_width, &h);
@@ -195,7 +193,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
195 /* if color selected */ 193 /* if color selected */
196 if (color >= 0) 194 if (color >= 0)
197 { 195 {
198 list_text[screen].drawmode |= STYLE_COLORED|color; 196 style |= STYLE_COLORED|color;
199 } 197 }
200 } 198 }
201#endif 199#endif
@@ -212,25 +210,25 @@ void list_draw(struct screen *display, struct gui_synclist *list)
212 ) 210 )
213 { 211 {
214 /* Display inverted-line-style */ 212 /* Display inverted-line-style */
215 list_text[screen].drawmode = STYLE_INVERT; 213 style = STYLE_INVERT;
216 } 214 }
217#ifdef HAVE_LCD_COLOR 215#ifdef HAVE_LCD_COLOR
218 else if (global_settings.cursor_style == 2) 216 else if (global_settings.cursor_style == 2)
219 { 217 {
220 /* Display colour line selector */ 218 /* Display colour line selector */
221 list_text[screen].drawmode = STYLE_COLORBAR; 219 style = STYLE_COLORBAR;
222 } 220 }
223 else if (global_settings.cursor_style == 3) 221 else if (global_settings.cursor_style == 3)
224 { 222 {
225 /* Display gradient line selector */ 223 /* Display gradient line selector */
226 list_text[screen].drawmode = STYLE_GRADIENT; 224 style = STYLE_GRADIENT;
227 225
228 /* Make the lcd driver know how many lines the gradient should 226 /* Make the lcd driver know how many lines the gradient should
229 cover and current line number */ 227 cover and current line number */
230 /* number of selected lines */ 228 /* number of selected lines */
231 list_text[screen].drawmode |= NUMLN_PACK(list->selected_size); 229 style |= NUMLN_PACK(list->selected_size);
232 /* current line number, zero based */ 230 /* current line number, zero based */
233 list_text[screen].drawmode |= CURLN_PACK(cur_line); 231 style |= CURLN_PACK(cur_line);
234 cur_line++; 232 cur_line++;
235 } 233 }
236#endif 234#endif
@@ -240,22 +238,22 @@ void list_draw(struct screen *display, struct gui_synclist *list)
240 { 238 {
241 /* don't scroll */ 239 /* don't scroll */
242 display->puts_style_offset(0, i-start, entry_name, 240 display->puts_style_offset(0, i-start, entry_name,
243 list_text[screen].drawmode, item_offset); 241 style, item_offset);
244 } 242 }
245 else 243 else
246 { 244 {
247 display->puts_scroll_style_offset(0, i-start, entry_name, 245 display->puts_scroll_style_offset(0, i-start, entry_name,
248 list_text[screen].drawmode, item_offset); 246 style, item_offset);
249 } 247 }
250 } 248 }
251 else 249 else
252 { 250 {
253 if (list->scroll_all) 251 if (list->scroll_all)
254 display->puts_scroll_style_offset(0, i-start, entry_name, 252 display->puts_scroll_style_offset(0, i-start, entry_name,
255 list_text[screen].drawmode, item_offset); 253 style, item_offset);
256 else 254 else
257 display->puts_style_offset(0, i-start, entry_name, 255 display->puts_style_offset(0, i-start, entry_name,
258 list_text[screen].drawmode, item_offset); 256 style, item_offset);
259 } 257 }
260 /* do the icon */ 258 /* do the icon */
261 if (list->callback_get_item_icon && global_settings.show_icons) 259 if (list->callback_get_item_icon && global_settings.show_icons)