From 05a67d021c8fbb10b2654f8378b549901dd4c520 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Mon, 6 May 2013 07:20:40 +0200 Subject: Touchscreen: Show a line separator in lists. This patch adds a configurable line separator between list items, very similar to lists in Android. Additionally, below the list item there is a thicker line. It can be disabled in the settings. Its color can be configured as well. Remote and monochrome displays are explicitly unsupported. If there is desire this can be changed but it doesn't seem useful to me. Change-Id: I005313b0d8f5ecd15864bf20e66ea4e3390d8b7d --- apps/gui/bitmap/list.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'apps/gui/bitmap/list.c') diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c index f1def9007d..97eefce9db 100644 --- a/apps/gui/bitmap/list.c +++ b/apps/gui/bitmap/list.c @@ -106,6 +106,13 @@ static bool draw_title(struct screen *display, struct gui_synclist *list) line.height = list->line_height[screen]; title_text_vp->height = line.height; +#if LCD_DEPTH > 1 + /* XXX: Do we want to support the separator on remote displays? */ + if (display->screen_type == SCREEN_MAIN && global_settings.list_separator_height != 0) + line.separator_height = abs(global_settings.list_separator_height) + + (lcd_get_dpi() > 200 ? 2 : 1); +#endif + #ifdef HAVE_LCD_COLOR if (list->title_color >= 0) line.style |= (STYLE_COLORED|list->title_color); @@ -154,7 +161,11 @@ void list_draw(struct screen *display, struct gui_synclist *list) linedes.height = list->line_height[screen]; linedes.nlines = list->selected_size; - +#if LCD_DEPTH > 1 + /* XXX: Do we want to support the separator on remote displays? */ + if (display->screen_type == SCREEN_MAIN) + linedes.separator_height = abs(global_settings.list_separator_height); +#endif start = list_start_item; end = start + nb_lines; -- cgit v1.2.3