Index: apps/gui/list.c =================================================================== --- apps/gui/list.c (revision 15024) +++ apps/gui/list.c (working copy) @@ -345,6 +345,9 @@ static void gui_list_draw_smart(struct g end++; } +#ifdef HAVE_LCD_COLOR + int nb_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 |= (nb_line<<8)&0xff00; /* current line number */ + nb_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 15024) +++ firmware/drivers/lcd-16bit.c (working copy) @@ -527,19 +527,25 @@ void lcd_fillrect(int x, int y, int widt } /* 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, int max_line, int nb_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 = ((lse_r - lss_r) * nb_line / max_line + lss_r) << 16; + int h_g = ((lse_g - lss_g) * nb_line / max_line + lss_g) << 16; + int h_b = ((lse_b - lss_b) * nb_line / max_line + lss_b) << 16; + int rstep = (h_r - (((lse_r-lss_r)*(nb_line+1)/max_line+lss_r) << 16)) / h; + int gstep = (h_g - (((lse_g-lss_g)*(nb_line+1)/max_line+lss_g) << 16)) / h; + int bstep = (h_b - (((lse_b-lss_b)*(nb_line+1)/max_line+lss_b) << 16)) / 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 +869,8 @@ 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, + style & 0xff, (style&0xff00)>>8); fg_pattern = lst_pattern; } else if (style & STYLE_COLORBAR) { @@ -1030,7 +1037,8 @@ 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, + s->style&0xff, (s->style&0xff00)>>8); fg_pattern = lst_pattern; break; default: