Fix yellow

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22956 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Tomer Shalev 2009-10-05 13:20:08 +00:00
parent 0b6f683137
commit bbeb3ec751

View file

@ -110,7 +110,7 @@ static bool draw_title(struct screen *display, struct gui_synclist *list)
void list_draw(struct screen *display, struct gui_synclist *list) void list_draw(struct screen *display, struct gui_synclist *list)
{ {
struct viewport list_icons; struct viewport list_icons;
int start, end, line_height, style, i; int start, end, line_height, style, i, scrollbar_in_left;
const int screen = display->screen_type; const int screen = display->screen_type;
const int icon_width = get_icon_width(screen) + ICON_PADDING; const int icon_width = get_icon_width(screen) + ICON_PADDING;
const bool show_cursor = !global_settings.cursor_style && const bool show_cursor = !global_settings.cursor_style &&
@ -134,7 +134,10 @@ void list_draw(struct screen *display, struct gui_synclist *list)
start = list->start_item[screen]; start = list->start_item[screen];
end = start + viewport_get_nb_lines(&list_text[screen]); end = start + viewport_get_nb_lines(&list_text[screen]);
scrollbar_in_left =
(!is_rtl && global_settings.scrollbar == SCROLLBAR_SHOW) ||
(is_rtl && global_settings.scrollbar == SCROLLBAR_SHOW_OPPOSITE);
/* draw the scrollbar if its needed */ /* draw the scrollbar if its needed */
if (global_settings.scrollbar && if (global_settings.scrollbar &&
viewport_get_nb_lines(&list_text[screen]) < list->nb_items) viewport_get_nb_lines(&list_text[screen]) < list->nb_items)
@ -146,15 +149,10 @@ void list_draw(struct screen *display, struct gui_synclist *list)
viewport_get_nb_lines(&list_text[screen]); viewport_get_nb_lines(&list_text[screen]);
vp.x = parent->x; vp.x = parent->x;
list_text[screen].width -= SCROLLBAR_WIDTH; list_text[screen].width -= SCROLLBAR_WIDTH;
if (!is_rtl && global_settings.scrollbar == SCROLLBAR_SHOW || if (scrollbar_in_left)
is_rtl && global_settings.scrollbar == SCROLLBAR_SHOW_OPPOSITE)
{
list_text[screen].x += SCROLLBAR_WIDTH; list_text[screen].x += SCROLLBAR_WIDTH;
}
else else
{
vp.x += list_text[screen].width; vp.x += list_text[screen].width;
}
display->set_viewport(&vp); display->set_viewport(&vp);
gui_scrollbar_draw(display, 0, 0, SCROLLBAR_WIDTH-1, gui_scrollbar_draw(display, 0, 0, SCROLLBAR_WIDTH-1,
vp.height, list->nb_items, vp.height, list->nb_items,
@ -164,9 +162,8 @@ void list_draw(struct screen *display, struct gui_synclist *list)
} }
else if (show_title) else if (show_title)
{ {
/* shift everything right a bit... */ /* shift everything a bit in relation to the title... */
if (!is_rtl && global_settings.scrollbar == SCROLLBAR_SHOW || if (scrollbar_in_left)
is_rtl && global_settings.scrollbar == SCROLLBAR_SHOW_OPPOSITE)
{ {
list_text[screen].width -= SCROLLBAR_WIDTH; list_text[screen].width -= SCROLLBAR_WIDTH;
list_text[screen].x += SCROLLBAR_WIDTH; list_text[screen].x += SCROLLBAR_WIDTH;