summaryrefslogtreecommitdiff
path: root/apps/gui/bitmap/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/bitmap/list.c')
-rw-r--r--apps/gui/bitmap/list.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index 94870538d6..ff29397532 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -40,6 +40,7 @@
40#include "sound.h" 40#include "sound.h"
41#include "misc.h" 41#include "misc.h"
42#include "viewport.h" 42#include "viewport.h"
43#include "language.h"
43 44
44#define ICON_PADDING 1 45#define ICON_PADDING 1
45 46
@@ -61,6 +62,9 @@ bool list_display_title(struct gui_synclist *list, enum screen_type screen);
61 | | | items | I - icons 62 | | | items | I - icons
62 | | | | 63 | | | |
63 ------------------ 64 ------------------
65
66 Note: This image is flipped horizontally when the language is a
67 right-to-left one (Hebrew, Arabic)
64*/ 68*/
65static bool draw_title(struct screen *display, struct gui_synclist *list) 69static bool draw_title(struct screen *display, struct gui_synclist *list)
66{ 70{
@@ -77,10 +81,17 @@ static bool draw_title(struct screen *display, struct gui_synclist *list)
77 struct viewport title_icon = title_text[screen]; 81 struct viewport title_icon = title_text[screen];
78 title_icon.width = get_icon_width(screen) 82 title_icon.width = get_icon_width(screen)
79 + ICON_PADDING*2; 83 + ICON_PADDING*2;
80 title_icon.x += ICON_PADDING; 84 if (lang_is_rtl())
81 85 {
86 title_icon.x = title_text[screen].width - ICON_PADDING -
87 get_icon_width(screen);
88 }
89 else
90 {
91 title_icon.x = ICON_PADDING;
92 title_text[screen].x += title_icon.width;
93 }
82 title_text[screen].width -= title_icon.width; 94 title_text[screen].width -= title_icon.width;
83 title_text[screen].x += title_icon.width;
84 95
85 display->set_viewport(&title_icon); 96 display->set_viewport(&title_icon);
86 screen_put_icon(display, 0, 0, list->title_icon); 97 screen_put_icon(display, 0, 0, list->title_icon);
@@ -108,7 +119,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
108#ifdef HAVE_LCD_COLOR 119#ifdef HAVE_LCD_COLOR
109 unsigned char cur_line = 0; 120 unsigned char cur_line = 0;
110#endif 121#endif
111 int item_offset; 122 int item_offset, is_rtl = lang_is_rtl();
112 bool show_title; 123 bool show_title;
113 line_height = font_get(parent->font)->height; 124 line_height = font_get(parent->font)->height;
114 display->set_viewport(parent); 125 display->set_viewport(parent);
@@ -132,12 +143,12 @@ void list_draw(struct screen *display, struct gui_synclist *list)
132 vp = list_text[screen]; 143 vp = list_text[screen];
133 vp.width = SCROLLBAR_WIDTH; 144 vp.width = SCROLLBAR_WIDTH;
134 list_text[screen].width -= SCROLLBAR_WIDTH; 145 list_text[screen].width -= SCROLLBAR_WIDTH;
135 if(global_settings.scrollbar == SCROLLBAR_LEFT) 146 if (global_settings.scrollbar == SCROLLBAR_SHOW)
136 list_text[screen].x += SCROLLBAR_WIDTH; 147 list_text[screen].x += SCROLLBAR_WIDTH;
137 vp.height = line_height * 148 vp.height = line_height *
138 viewport_get_nb_lines(&list_text[screen]); 149 viewport_get_nb_lines(&list_text[screen]);
139 vp.x = parent->x; 150 vp.x = parent->x;
140 if(global_settings.scrollbar == SCROLLBAR_RIGHT) 151 if (global_settings.scrollbar == SCROLLBAR_SHOW_OPPOSITE)
141 vp.x += list_text[screen].width; 152 vp.x += list_text[screen].width;
142 display->set_viewport(&vp); 153 display->set_viewport(&vp);
143 gui_scrollbar_draw(display, 0, 0, SCROLLBAR_WIDTH-1, 154 gui_scrollbar_draw(display, 0, 0, SCROLLBAR_WIDTH-1,
@@ -149,7 +160,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
149 else if (show_title) 160 else if (show_title)
150 { 161 {
151 /* shift everything right a bit... */ 162 /* shift everything right a bit... */
152 if(global_settings.scrollbar == SCROLLBAR_LEFT) 163 if (global_settings.scrollbar == SCROLLBAR_SHOW)
153 { 164 {
154 list_text[screen].width -= SCROLLBAR_WIDTH; 165 list_text[screen].width -= SCROLLBAR_WIDTH;
155 list_text[screen].x += SCROLLBAR_WIDTH; 166 list_text[screen].x += SCROLLBAR_WIDTH;
@@ -167,8 +178,10 @@ void list_draw(struct screen *display, struct gui_synclist *list)
167 list_icons.width = icon_width * icon_count; 178 list_icons.width = icon_width * icon_count;
168 list_text[screen].width -= 179 list_text[screen].width -=
169 list_icons.width + ICON_PADDING; 180 list_icons.width + ICON_PADDING;
170 list_text[screen].x += 181 if (is_rtl)
171 list_icons.width + ICON_PADDING; 182 list_icons.x += list_text[screen].width;
183 else
184 list_text[screen].x += list_icons.width + ICON_PADDING;
172 } 185 }
173 186
174 for (i=start; i<end && i<list->nb_items; i++) 187 for (i=start; i<end && i<list->nb_items; i++)