Index: apps/gui/list.c =================================================================== --- apps/gui/list.c (revision 15068) +++ apps/gui/list.c (working copy) @@ -345,6 +345,9 @@ static void gui_list_draw_smart(struct g end++; } +#ifdef HAVE_LCD_BITMAP + unsigned char cur_line = 1; +#endif for (i = start; i < end; i++) { unsigned char *s; @@ -411,9 +414,12 @@ 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 */ + /* max line number*/ + style |= MAXLN_PACK(gui_list->selected_size); + /* current line number */ + style |= CURLN_PACK(cur_line); + cur_line++; } #endif else /* if (!global_settings.cursor_style) */ Index: firmware/export/lcd.h =================================================================== --- firmware/export/lcd.h (revision 15068) +++ firmware/export/lcd.h (working copy) @@ -31,6 +31,14 @@ #define STYLE_GRADIENT 0x80000000 #define STYLE_MODE_MASK 0xF0000000 #define STYLE_COLOR_MASK 0x0000FFFF +#ifdef HAVE_LCD_COLOR +#define STYLE_CURLN_MASK 0x0000FF00 +#define STYLE_MAXLN_MASK 0x000000FF +#define CURLN_PACK(x) (((x)<<8) & STYLE_CURLN_MASK) +#define CURLN_UNPACK(x) ((unsigned char)(((x)&STYLE_CURLN_MASK) >> 8)) +#define MAXLN_PACK(x) ((x) & STYLE_MAXLN_MASK) +#define MAXLN_UNPACK(x) ((unsigned char)((x) & STYLE_MAXLN_MASK)) +#endif #ifdef SIMULATOR #ifndef MAX_PATH Index: firmware/drivers/lcd-16bit.c =================================================================== --- firmware/drivers/lcd-16bit.c (revision 15068) +++ firmware/drivers/lcd-16bit.c (working copy) @@ -549,6 +549,40 @@ void lcd_gradient_rect(int x1, int x2, i } } +#define h_color(lss, lse, cur_line, max_line) \ + (((lse) - (lss)) * (cur_line) / (max_line) + (lss)) + +/* Fill a rectangle with a gradient for scrolling line */ +void lcd_gradient_rect_scroll(int x1, int x2, int y, int h, + unsigned char max_line, unsigned char cur_line) +{ + if (h == 0 || max_line == 0) return; + + unsigned tmp_lss = lss_pattern; + unsigned tmp_lse = lse_pattern; + 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, cur_line-1, max_line); + int h_g = h_color(lss_g, lse_g, cur_line-1, max_line); + int h_b = h_color(lss_b, lse_b, cur_line-1, max_line); + lcd_set_selector_start(LCD_RGBPACK(h_r, h_g, h_b)); + + int l_r = h_color(lss_r, lse_r, cur_line, max_line); + int l_g = h_color(lss_g, lse_g, cur_line, max_line); + int l_b = h_color(lss_b, lse_b, cur_line, max_line); + lcd_set_selector_end(LCD_RGBPACK(l_r, l_g, l_b)); + + lcd_gradient_rect(x1, x2, y, h); + + lcd_set_selector_start(tmp_lss); + lcd_set_selector_end(tmp_lse); +} + /* About Rockbox' internal monochrome bitmap format: * * A bitmap contains one bit for every pixel that defines if that pixel is @@ -863,7 +897,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)); + if (CURLN_UNPACK(style) == 1) + lcd_gradient_rect(xpos, LCD_WIDTH, ypos, h*MAXLN_UNPACK(style)); fg_pattern = lst_pattern; } else if (style & STYLE_COLORBAR) { @@ -1030,7 +1065,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_scroll(0, LCD_WIDTH, ypos, (signed)pf->height, + MAXLN_UNPACK(s->style), + CURLN_UNPACK(s->style)); fg_pattern = lst_pattern; break; default: