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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index 44587cd378..953ce1b1d7 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -44,6 +44,10 @@
44 44
45#define ICON_PADDING 1 45#define ICON_PADDING 1
46 46
47#define UPDATE_RTL(vp) \
48 (vp)->flags &= ~VP_IS_RTL; \
49 (vp)->flags |= lang_is_rtl() ? VP_IS_RTL : 0;
50
47/* these are static to make scrolling work */ 51/* these are static to make scrolling work */
48static struct viewport list_text[NB_SCREENS], title_text[NB_SCREENS]; 52static struct viewport list_text[NB_SCREENS], title_text[NB_SCREENS];
49 53
@@ -76,12 +80,14 @@ static bool draw_title(struct screen *display, struct gui_synclist *list)
76 if (!list_display_title(list, screen)) 80 if (!list_display_title(list, screen))
77 return false; 81 return false;
78 *title_text_vp = *(list->parent[screen]); 82 *title_text_vp = *(list->parent[screen]);
83 UPDATE_RTL(title_text_vp);
79 title_text_vp->height = font_get(title_text_vp->font)->height; 84 title_text_vp->height = font_get(title_text_vp->font)->height;
80 85
81 if (list->title_icon != Icon_NOICON && global_settings.show_icons) 86 if (list->title_icon != Icon_NOICON && global_settings.show_icons)
82 { 87 {
83 struct viewport title_icon = *title_text_vp; 88 struct viewport title_icon = *title_text_vp;
84 89
90 UPDATE_RTL(&title_icon);
85 title_icon.width = get_icon_width(screen) + ICON_PADDING * 2; 91 title_icon.width = get_icon_width(screen) + ICON_PADDING * 2;
86 if (lang_is_rtl()) 92 if (lang_is_rtl())
87 { 93 {
@@ -132,6 +138,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
132 display->clear_viewport(); 138 display->clear_viewport();
133 display->scroll_stop(list_text_vp); 139 display->scroll_stop(list_text_vp);
134 *list_text_vp = *parent; 140 *list_text_vp = *parent;
141 UPDATE_RTL(list_text_vp);
135 if ((show_title = draw_title(display, list))) 142 if ((show_title = draw_title(display, list)))
136 { 143 {
137 list_text_vp->y += line_height; 144 list_text_vp->y += line_height;
@@ -172,6 +179,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
172 179
173 /* setup icon placement */ 180 /* setup icon placement */
174 list_icons = *list_text_vp; 181 list_icons = *list_text_vp;
182 UPDATE_RTL(&list_icons);
175 int icon_count = global_settings.show_icons && 183 int icon_count = global_settings.show_icons &&
176 (list->callback_get_item_icon != NULL) ? 1 : 0; 184 (list->callback_get_item_icon != NULL) ? 1 : 0;
177 if (show_cursor) 185 if (show_cursor)