Index: apps/gui/list.c =================================================================== --- apps/gui/list.c (revision 15026) +++ apps/gui/list.c (working copy) @@ -345,6 +345,9 @@ static void gui_list_draw_smart(struct g end++; } +#ifdef HAVE_LCD_COLOR + unsigned char nr_line = 0; +#endif for (i = start; i < end; i++) { unsigned char *s; @@ -411,9 +414,10 @@ static void gui_list_draw_smart(struct g style = STYLE_GRADIENT; /* Make the lcd driver know how many lines the gradient should - cover and only draw it for the first selected item. */ - if (current_item == gui_list->selected_item) - style |= gui_list->selected_size & STYLE_COLOR_MASK; + cover and current line number */ + style |= (nr_line<<8)&0xff00; /* current line number */ + nr_line++; + style |= gui_list->selected_size & 0xff; /* max line number */ } #endif else /* if (!global_settings.cursor_style) */ Index: firmware/drivers/lcd-16bit.c =================================================================== --- firmware/drivers/lcd-16bit.c (revision 15026) +++ firmware/drivers/lcd-16bit.c (working copy) @@ -526,20 +526,30 @@ void lcd_fillrect(int x, int y, int widt while (dst < dst_end); } +#define h_color(lss, lse, nr_line, max_line) \ + ((((lse) - (lss)) * (nr_line) / (max_line) + (lss)) << 16) + /* Fill a rectangle with a gradient */ -void lcd_gradient_rect(int x1, int x2, int y, int h) +void lcd_gradient_rect(int x1, int x2, int y, int h, + unsigned char max_line, unsigned char nr_line) { if (h == 0) return; - int h_r = RGB_UNPACK_RED(lss_pattern) << 16; - int h_b = RGB_UNPACK_BLUE(lss_pattern) << 16; - int h_g = RGB_UNPACK_GREEN(lss_pattern) << 16; - int rstep = (h_r - ((signed)RGB_UNPACK_RED(lse_pattern) << 16)) / h; - int gstep = (h_g - ((signed)RGB_UNPACK_GREEN(lse_pattern) << 16)) / h; - int bstep = (h_b - ((signed)RGB_UNPACK_BLUE(lse_pattern) << 16)) / h; + int lss_r = (signed)RGB_UNPACK_RED(lss_pattern); + int lss_b = (signed)RGB_UNPACK_BLUE(lss_pattern); + int lss_g = (signed)RGB_UNPACK_GREEN(lss_pattern); + int lse_r = (signed)RGB_UNPACK_RED(lse_pattern); + int lse_b = (signed)RGB_UNPACK_BLUE(lse_pattern); + int lse_g = (signed)RGB_UNPACK_GREEN(lse_pattern); + int h_r = h_color(lss_r, lse_r, nr_line, max_line); + int h_g = h_color(lss_g, lse_g, nr_line, max_line); + int h_b = h_color(lss_b, lse_b, nr_line, max_line); + int rstep = (h_r - h_color(lss_r, lse_r, nr_line+1, max_line)) / h; + int gstep = (h_g - h_color(lss_g, lse_g, nr_line+1, max_line)) / h; + int bstep = (h_b - h_color(lss_b, lse_b, nr_line+1, max_line)) / h; int count; - fg_pattern = lss_pattern; + fg_pattern = LCD_RGBPACK(h_r >> 16, h_g >> 16, h_b >> 16); for(count = 0; count < h; count++) { lcd_hline(x1, x2, y + count); h_r -= rstep; @@ -863,7 +873,9 @@ void lcd_puts_style_offset(int x, int y, if (style & STYLE_GRADIENT) { drawmode = DRMODE_FG; - lcd_gradient_rect(xpos, LCD_WIDTH, ypos, h*(style & STYLE_COLOR_MASK)); + lcd_gradient_rect(xpos, LCD_WIDTH, ypos, h, + (unsigned char)(style & 0xff), + (unsigned char)((style&0xff00)>>8)); fg_pattern = lst_pattern; } else if (style & STYLE_COLORBAR) { @@ -1030,7 +1042,9 @@ void lcd_scroll_fn(void) case STYLE_GRADIENT: /* Gradient line selector */ drawmode = DRMODE_FG; - lcd_gradient_rect(0, LCD_WIDTH, ypos, (signed)pf->height); + lcd_gradient_rect(0, LCD_WIDTH, ypos, (signed)pf->height, + (unsigned char)(s->style&0xff), + (unsigned char)((s->style&0xff00)>>8)); fg_pattern = lst_pattern; break; default: