summaryrefslogtreecommitdiffstats
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.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index 953ce1b1d7..5183880aa8 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -40,13 +40,9 @@
#include "sound.h"
#include "misc.h"
#include "viewport.h"
-#include "language.h"
#define ICON_PADDING 1
-
-#define UPDATE_RTL(vp) \
- (vp)->flags &= ~VP_IS_RTL; \
- (vp)->flags |= lang_is_rtl() ? VP_IS_RTL : 0;
+#define IS_RTL(vp) (((vp)->flags & VP_IS_RTL) != 0)
/* these are static to make scrolling work */
static struct viewport list_text[NB_SCREENS], title_text[NB_SCREENS];
@@ -80,16 +76,14 @@ static bool draw_title(struct screen *display, struct gui_synclist *list)
if (!list_display_title(list, screen))
return false;
*title_text_vp = *(list->parent[screen]);
- UPDATE_RTL(title_text_vp);
title_text_vp->height = font_get(title_text_vp->font)->height;
if (list->title_icon != Icon_NOICON && global_settings.show_icons)
{
struct viewport title_icon = *title_text_vp;
- UPDATE_RTL(&title_icon);
title_icon.width = get_icon_width(screen) + ICON_PADDING * 2;
- if (lang_is_rtl())
+ if (IS_RTL(&title_icon))
{
title_icon.x = title_text_vp->width - ICON_PADDING -
get_icon_width(screen);
@@ -129,7 +123,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
#ifdef HAVE_LCD_COLOR
unsigned char cur_line = 0;
#endif
- int item_offset, is_rtl = lang_is_rtl();
+ int item_offset;
bool show_title;
struct viewport *list_text_vp = &list_text[screen];
@@ -138,7 +132,6 @@ void list_draw(struct screen *display, struct gui_synclist *list)
display->clear_viewport();
display->scroll_stop(list_text_vp);
*list_text_vp = *parent;
- UPDATE_RTL(list_text_vp);
if ((show_title = draw_title(display, list)))
{
list_text_vp->y += line_height;
@@ -179,7 +172,6 @@ void list_draw(struct screen *display, struct gui_synclist *list)
/* setup icon placement */
list_icons = *list_text_vp;
- UPDATE_RTL(&list_icons);
int icon_count = global_settings.show_icons &&
(list->callback_get_item_icon != NULL) ? 1 : 0;
if (show_cursor)
@@ -188,7 +180,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)
+ if (IS_RTL(&list_icons))
list_icons.x += list_text_vp->width;
else
list_text_vp->x += list_icons.width + ICON_PADDING;