summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-09-28 13:49:43 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-09-28 13:49:43 +0000
commit49a9e1ef35085dd1b348bb7949f32cd4db043506 (patch)
tree0b3344dc8c91ef9b52f13520024a5d16dc6a16a8
parentf333c97176bfed3c66c44e44d28ad84d99bc071f (diff)
downloadrockbox-49a9e1ef35085dd1b348bb7949f32cd4db043506.tar.gz
rockbox-49a9e1ef35085dd1b348bb7949f32cd4db043506.zip
Make the gradient look better when more than one line is selected (running time, ID3 info, cuesheet viewer...). I haven't found a solution for scrolling yet, so that won't look too good.
The recording screen code needs a bit of adapting too, but I don't have a target to test on, so leave it for now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14884 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/list.c5
-rw-r--r--apps/recorder/recording.c2
-rw-r--r--firmware/drivers/lcd-16bit.c4
3 files changed, 9 insertions, 2 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c
index 6a7d21cc4b..aca0105967 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -409,6 +409,11 @@ static void gui_list_draw_smart(struct gui_list *gui_list)
409 { 409 {
410 /* Display gradient line selector */ 410 /* Display gradient line selector */
411 style |= STYLE_GRADIENT; 411 style |= STYLE_GRADIENT;
412
413 /* Make the lcd driver know how many lines the gradient should
414 cover and only draw it for the first selected item. */
415 if (current_item == gui_list->selected_item)
416 style |= gui_list->selected_size & STYLE_COLOR_MASK;
412 } 417 }
413#endif 418#endif
414 else /* if (!global_settings.cursor_style) */ 419 else /* if (!global_settings.cursor_style) */
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index bd04d26929..fed2e6767e 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -863,7 +863,7 @@ bool recording_screen(bool no_source)
863 style |= STYLE_COLORBAR; 863 style |= STYLE_COLORBAR;
864 } 864 }
865 else if (global_settings.cursor_style == 3) { 865 else if (global_settings.cursor_style == 3) {
866 style |= STYLE_GRADIENT; 866 style |= STYLE_GRADIENT | 1;
867 } 867 }
868#endif 868#endif
869 869
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c
index 2d228b6566..f748b4027c 100644
--- a/firmware/drivers/lcd-16bit.c
+++ b/firmware/drivers/lcd-16bit.c
@@ -529,6 +529,8 @@ void lcd_fillrect(int x, int y, int width, int height)
529/* Fill a rectangle with a gradient */ 529/* Fill a rectangle with a gradient */
530void lcd_gradient_rect(int x1, int x2, int y, int h) 530void lcd_gradient_rect(int x1, int x2, int y, int h)
531{ 531{
532 if (h == 0) return;
533
532 int h_r = RGB_UNPACK_RED(lss_pattern) << 16; 534 int h_r = RGB_UNPACK_RED(lss_pattern) << 16;
533 int h_b = RGB_UNPACK_BLUE(lss_pattern) << 16; 535 int h_b = RGB_UNPACK_BLUE(lss_pattern) << 16;
534 int h_g = RGB_UNPACK_GREEN(lss_pattern) << 16; 536 int h_g = RGB_UNPACK_GREEN(lss_pattern) << 16;
@@ -861,7 +863,7 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style,
861 863
862 if (style & STYLE_GRADIENT) { 864 if (style & STYLE_GRADIENT) {
863 drawmode = DRMODE_FG; 865 drawmode = DRMODE_FG;
864 lcd_gradient_rect(xpos, LCD_WIDTH, ypos, h); 866 lcd_gradient_rect(xpos, LCD_WIDTH, ypos, h*(style & STYLE_COLOR_MASK));
865 fg_pattern = lst_pattern; 867 fg_pattern = lst_pattern;
866 } 868 }
867 else if (style & STYLE_COLORBAR) { 869 else if (style & STYLE_COLORBAR) {