summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/bitmap/list.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index aad3eda98f..45e6c03dcf 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -154,6 +154,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
154 int icon_yoffset = 0; /* to center the icon */ 154 int icon_yoffset = 0; /* to center the icon */
155 bool show_title; 155 bool show_title;
156 struct viewport *list_text_vp = &list_text[screen]; 156 struct viewport *list_text_vp = &list_text[screen];
157 int indent = 0;
157 158
158 line_height = parent->line_height; 159 line_height = parent->line_height;
159 display->set_viewport(parent); 160 display->set_viewport(parent);
@@ -249,9 +250,28 @@ void list_draw(struct screen *display, struct gui_synclist *list)
249 unsigned char *entry_name; 250 unsigned char *entry_name;
250 int text_pos = 0; 251 int text_pos = 0;
251 int line = i - start; 252 int line = i - start;
253 indent = 0;
252 s = list->callback_get_item_name(i, list->data, entry_buffer, 254 s = list->callback_get_item_name(i, list->data, entry_buffer,
253 sizeof(entry_buffer)); 255 sizeof(entry_buffer));
254 entry_name = P2STR(s); 256 entry_name = P2STR(s);
257
258 while (*entry_name == '\t')
259 {
260 indent++;
261 entry_name++;
262 }
263 if (indent)
264 {
265 if (icon_width)
266 indent *= icon_width;
267 else
268 indent *= display->getcharwidth();
269
270 list_icons.x += indent;
271 list_text_vp->x += indent;
272 list_text_vp->width -= indent;
273 }
274
255 display->set_viewport(list_text_vp); 275 display->set_viewport(list_text_vp);
256 style = STYLE_DEFAULT; 276 style = STYLE_DEFAULT;
257 /* position the string at the correct offset place */ 277 /* position the string at the correct offset place */
@@ -353,6 +373,12 @@ void list_draw(struct screen *display, struct gui_synclist *list)
353 line*line_height + draw_offset + icon_yoffset, 373 line*line_height + draw_offset + icon_yoffset,
354 Icon_Cursor); 374 Icon_Cursor);
355 } 375 }
376 if (indent)
377 {
378 list_icons.x -= indent;
379 list_text_vp->x -= indent;
380 list_text_vp->width += indent;
381 }
356 } 382 }
357 display->set_viewport(parent); 383 display->set_viewport(parent);
358 display->update_viewport(); 384 display->update_viewport();