summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomer Shalev <shalev.tomer@gmail.com>2009-10-05 23:41:59 +0000
committerTomer Shalev <shalev.tomer@gmail.com>2009-10-05 23:41:59 +0000
commit6a12b82a8533e8e0a835f6d1ee1e1076f8ef2df6 (patch)
tree1e4cab476a51ea2c58df0dba7784b80bea32eee1
parentfa69df3324847b4bac34a54e58ac566dcc51835a (diff)
downloadrockbox-6a12b82a8533e8e0a835f6d1ee1e1076f8ef2df6.tar.gz
rockbox-6a12b82a8533e8e0a835f6d1ee1e1076f8ef2df6.zip
Fine tuning of gui elements positioning in RTL mode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22976 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/bitmap/list.c13
-rw-r--r--apps/gui/icon.c5
2 files changed, 12 insertions, 6 deletions
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)
85 title_icon.width = get_icon_width(screen) + ICON_PADDING * 2; 85 title_icon.width = get_icon_width(screen) + ICON_PADDING * 2;
86 if (IS_RTL(&title_icon)) 86 if (IS_RTL(&title_icon))
87 { 87 {
88 title_icon.x = title_text_vp->width - ICON_PADDING - 88 title_icon.x = title_text_vp->width - title_icon.width;
89 get_icon_width(screen);
90 } 89 }
91 else 90 else
92 { 91 {
@@ -156,18 +155,22 @@ void list_draw(struct screen *display, struct gui_synclist *list)
156 else 155 else
157 vp.x += list_text_vp->width; 156 vp.x += list_text_vp->width;
158 display->set_viewport(&vp); 157 display->set_viewport(&vp);
159 gui_scrollbar_draw(display, 0, 0, SCROLLBAR_WIDTH-1, vp.height, 158 gui_scrollbar_draw(display, IS_RTL(&vp) ? 1 : 0, 0, SCROLLBAR_WIDTH-1, vp.height,
160 list->nb_items, list_start_item, list_start_item + end-start, 159 list->nb_items, list_start_item, list_start_item + end-start,
161 VERTICAL); 160 VERTICAL);
162 } 161 }
163 else if (show_title) 162 else if (show_title)
164 { 163 {
165 /* shift everything a bit in relation to the title... */ 164 /* shift everything a bit in relation to the title... */
166 if (scrollbar_in_left) 165 if (!IS_RTL(list_text_vp) && scrollbar_in_left)
167 { 166 {
168 list_text_vp->width -= SCROLLBAR_WIDTH; 167 list_text_vp->width -= SCROLLBAR_WIDTH;
169 list_text_vp->x += SCROLLBAR_WIDTH; 168 list_text_vp->x += SCROLLBAR_WIDTH;
170 } 169 }
170 else if (IS_RTL(list_text_vp) && !scrollbar_in_left)
171 {
172 list_text_vp->width -= SCROLLBAR_WIDTH;
173 }
171 } 174 }
172 175
173 /* setup icon placement */ 176 /* setup icon placement */
@@ -181,7 +184,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
181 list_icons.width = icon_width * icon_count; 184 list_icons.width = icon_width * icon_count;
182 list_text_vp->width -= list_icons.width + ICON_PADDING; 185 list_text_vp->width -= list_icons.width + ICON_PADDING;
183 if (IS_RTL(&list_icons)) 186 if (IS_RTL(&list_icons))
184 list_icons.x += list_text_vp->width; 187 list_icons.x += list_text_vp->width + ICON_PADDING;
185 else 188 else
186 list_text_vp->x += list_icons.width + ICON_PADDING; 189 list_text_vp->x += list_icons.width + ICON_PADDING;
187 } 190 }
diff --git a/apps/gui/icon.c b/apps/gui/icon.c
index e57ad29f6d..73c0fb598c 100644
--- a/apps/gui/icon.c
+++ b/apps/gui/icon.c
@@ -125,12 +125,15 @@ void screen_put_iconxy(struct screen * display,
125 const int screen = display->screen_type; 125 const int screen = display->screen_type;
126 const int width = ICON_WIDTH(screen); 126 const int width = ICON_WIDTH(screen);
127 const int height = ICON_HEIGHT(screen); 127 const int height = ICON_HEIGHT(screen);
128 const int is_rtl = lang_is_rtl();
128 int stride; 129 int stride;
129 const struct bitmap *iconset; 130 const struct bitmap *iconset;
130 screen_bitmap_part_func *draw_func = NULL; 131 screen_bitmap_part_func *draw_func = NULL;
131 132
132 if (icon == Icon_NOICON) 133 if (icon == Icon_NOICON)
133 { 134 {
135 if (is_rtl)
136 xpos = display->getwidth() - xpos - width;
134 screen_clear_area(display, xpos, ypos, width, height); 137 screen_clear_area(display, xpos, ypos, width, height);
135 return; 138 return;
136 } 139 }
@@ -164,7 +167,7 @@ void screen_put_iconxy(struct screen * display,
164 if (xpos == 0) 167 if (xpos == 0)
165 xpos++; 168 xpos++;
166 169
167 if (lang_is_rtl()) 170 if (is_rtl)
168 xpos = display->getwidth() - xpos - width; 171 xpos = display->getwidth() - xpos - width;
169 172
170#if (LCD_DEPTH == 16) || defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH == 16) 173#if (LCD_DEPTH == 16) || defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH == 16)