From 6a12b82a8533e8e0a835f6d1ee1e1076f8ef2df6 Mon Sep 17 00:00:00 2001 From: Tomer Shalev Date: Mon, 5 Oct 2009 23:41:59 +0000 Subject: Fine tuning of gui elements positioning in RTL mode git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22976 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/bitmap/list.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'apps/gui/bitmap') diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c index c94b6037af..f0eb2ec160 100644 --- a/apps/gui/bitmap/list.c +++ b/apps/gui/bitmap/list.c @@ -85,8 +85,7 @@ static bool draw_title(struct screen *display, struct gui_synclist *list) title_icon.width = get_icon_width(screen) + ICON_PADDING * 2; if (IS_RTL(&title_icon)) { - title_icon.x = title_text_vp->width - ICON_PADDING - - get_icon_width(screen); + title_icon.x = title_text_vp->width - title_icon.width; } else { @@ -156,18 +155,22 @@ void list_draw(struct screen *display, struct gui_synclist *list) else vp.x += list_text_vp->width; display->set_viewport(&vp); - gui_scrollbar_draw(display, 0, 0, SCROLLBAR_WIDTH-1, vp.height, + gui_scrollbar_draw(display, IS_RTL(&vp) ? 1 : 0, 0, SCROLLBAR_WIDTH-1, vp.height, list->nb_items, list_start_item, list_start_item + end-start, VERTICAL); } else if (show_title) { /* shift everything a bit in relation to the title... */ - if (scrollbar_in_left) + if (!IS_RTL(list_text_vp) && scrollbar_in_left) { list_text_vp->width -= SCROLLBAR_WIDTH; list_text_vp->x += SCROLLBAR_WIDTH; } + else if (IS_RTL(list_text_vp) && !scrollbar_in_left) + { + list_text_vp->width -= SCROLLBAR_WIDTH; + } } /* setup icon placement */ @@ -181,7 +184,7 @@ void list_draw(struct screen *display, struct gui_synclist *list) list_icons.width = icon_width * icon_count; list_text_vp->width -= list_icons.width + ICON_PADDING; if (IS_RTL(&list_icons)) - list_icons.x += list_text_vp->width; + list_icons.x += list_text_vp->width + ICON_PADDING; else list_text_vp->x += list_icons.width + ICON_PADDING; } -- cgit v1.2.3