From f3b015f73b29f2d3514c32a9b8b8f0338b52e358 Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Thu, 27 Sep 2007 15:42:55 +0000 Subject: FS#7808 by Tom Ross, Ken Fazzone and me, with help from Antoine Cellerier. Add two new line selector types: solid colour and gradient. Solid colour only uses the primary colour setting. The secondary colour setting is used for the gradient. Text colour for the selected item is also changeable. These new settings are a bit controversial so they may be removed later. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14868 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/color_picker.c | 2 +- apps/gui/list.c | 25 +++++++++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) (limited to 'apps/gui') diff --git a/apps/gui/color_picker.c b/apps/gui/color_picker.c index 1116aaae23..513db74bf9 100644 --- a/apps/gui/color_picker.c +++ b/apps/gui/color_picker.c @@ -200,7 +200,7 @@ static void draw_screen(struct screen *display, char *title, set_drawinfo(display, DRMODE_SOLID, text_color, background_color); - if (global_settings.invert_cursor) + if (global_settings.cursor_style != 0) { /* Draw solid bar selection bar */ display->fillrect(0, diff --git a/apps/gui/list.c b/apps/gui/list.c index a8bbce8cda..6a7d21cc4b 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -141,7 +141,7 @@ static void gui_list_flash(struct gui_list * gui_list) int selected_line=gui_list->selected_item-gui_list->start_item+SHOW_LIST_TITLE; #ifdef HAVE_LCD_BITMAP int line_ypos=display->getymargin()+display->char_height*selected_line; - if (global_settings.invert_cursor) + if (global_settings.cursor_style) { int line_xpos=display->getxmargin(); display->set_drawmode(DRMODE_COMPLEMENT); @@ -313,7 +313,7 @@ static void gui_list_draw_smart(struct gui_list *gui_list) draw_scrollbar = (global_settings.scrollbar && lines < gui_list->nb_items); - draw_cursor = !global_settings.invert_cursor && + draw_cursor = !global_settings.cursor_style && gui_list->show_selection_marker; text_pos = 0; /* here it's in pixels */ if(draw_scrollbar || SHOW_LIST_TITLE) /* indent if there's @@ -390,11 +390,28 @@ static void gui_list_draw_smart(struct gui_list *gui_list) current_item < gui_list->selected_item + gui_list->selected_size) {/* The selected item must be displayed scrolling */ #ifdef HAVE_LCD_BITMAP - if (global_settings.invert_cursor)/* Display inverted-line-style*/ + if (global_settings.cursor_style == 1 +#ifdef HAVE_REMOTE_LCD + || display->screen_type == SCREEN_REMOTE +#endif + ) { + /* Display inverted-line-style */ style |= STYLE_INVERT; } - else /* if (!global_settings.invert_cursor) */ +#ifdef HAVE_LCD_COLOR + else if (global_settings.cursor_style == 2) + { + /* Display colour line selector */ + style |= STYLE_COLORBAR; + } + else if (global_settings.cursor_style == 3) + { + /* Display gradient line selector */ + style |= STYLE_GRADIENT; + } +#endif + else /* if (!global_settings.cursor_style) */ { if (current_item % gui_list->selected_size != 0) draw_cursor = false; -- cgit v1.2.3