diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/action.c | 22 | ||||
-rw-r--r-- | apps/menus/display_menu.c | 2 | ||||
-rw-r--r-- | apps/settings.c | 2 |
3 files changed, 24 insertions, 2 deletions
diff --git a/apps/action.c b/apps/action.c index ee84706b09..cde57441e7 100644 --- a/apps/action.c +++ b/apps/action.c | |||
@@ -34,6 +34,9 @@ | |||
34 | #include "settings.h" | 34 | #include "settings.h" |
35 | #include "pcmbuf.h" | 35 | #include "pcmbuf.h" |
36 | #include "misc.h" | 36 | #include "misc.h" |
37 | #if defined(HAVE_LCD_BITMAP) && !defined(BOOTLOADER) | ||
38 | #include "language.h" | ||
39 | #endif | ||
37 | 40 | ||
38 | static int last_button = BUTTON_NONE|BUTTON_REL; /* allow the ipod wheel to | 41 | static int last_button = BUTTON_NONE|BUTTON_REL; /* allow the ipod wheel to |
39 | work on startup */ | 42 | work on startup */ |
@@ -56,6 +59,20 @@ static int unlock_combo = BUTTON_NONE; | |||
56 | static bool screen_has_lock = false; | 59 | static bool screen_has_lock = false; |
57 | #endif /* HAVE_SOFTWARE_KEYLOCK */ | 60 | #endif /* HAVE_SOFTWARE_KEYLOCK */ |
58 | 61 | ||
62 | #if defined(HAVE_LCD_BITMAP) && !defined(BOOTLOADER) | ||
63 | /* | ||
64 | * checks whether the given language and context combination require that the | ||
65 | * button is horizontally inverted to support RTL language | ||
66 | * | ||
67 | */ | ||
68 | static bool rtl_button_flip_needed(int context) | ||
69 | { | ||
70 | return lang_is_rtl() && ((context == CONTEXT_STD) || | ||
71 | (context & CONTEXT_TREE) || (context & CONTEXT_MAINMENU) || | ||
72 | (context & CONTEXT_TREE)); | ||
73 | } | ||
74 | #endif | ||
75 | |||
59 | /* | 76 | /* |
60 | * do_button_check is the worker function for get_default_action. | 77 | * do_button_check is the worker function for get_default_action. |
61 | * returns ACTION_UNKNOWN or the requested return value from the list. | 78 | * returns ACTION_UNKNOWN or the requested return value from the list. |
@@ -201,6 +218,11 @@ static int get_action_worker(int context, int timeout, | |||
201 | context &= ~ALLOW_SOFTLOCK; | 218 | context &= ~ALLOW_SOFTLOCK; |
202 | #endif /* HAS_BUTTON_HOLD */ | 219 | #endif /* HAS_BUTTON_HOLD */ |
203 | 220 | ||
221 | #if defined(HAVE_LCD_BITMAP) && !defined(BOOTLOADER) | ||
222 | if (rtl_button_flip_needed(context)) | ||
223 | button = button_flip_horizontally(button); | ||
224 | #endif | ||
225 | |||
204 | /* logf("%x,%x",last_button,button); */ | 226 | /* logf("%x,%x",last_button,button); */ |
205 | while (1) | 227 | while (1) |
206 | { | 228 | { |
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c index 5559ecebe7..afbb19c60d 100644 --- a/apps/menus/display_menu.c +++ b/apps/menus/display_menu.c | |||
@@ -67,7 +67,7 @@ static int flipdisplay_callback(int action,const struct menu_item_ex *this_item) | |||
67 | switch (action) | 67 | switch (action) |
68 | { | 68 | { |
69 | case ACTION_EXIT_MENUITEM: | 69 | case ACTION_EXIT_MENUITEM: |
70 | button_set_flip(global_settings.flip_display); | 70 | button_set_flip_vertically(global_settings.flip_display); |
71 | lcd_set_flip(global_settings.flip_display); | 71 | lcd_set_flip(global_settings.flip_display); |
72 | lcd_update(); | 72 | lcd_update(); |
73 | #ifdef HAVE_REMOTE_LCD | 73 | #ifdef HAVE_REMOTE_LCD |
diff --git a/apps/settings.c b/apps/settings.c index ce1ee07054..ac80d12492 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -846,7 +846,7 @@ void settings_apply(bool read_disk) | |||
846 | #endif | 846 | #endif |
847 | #ifdef HAVE_LCD_FLIP | 847 | #ifdef HAVE_LCD_FLIP |
848 | lcd_set_flip(global_settings.flip_display); | 848 | lcd_set_flip(global_settings.flip_display); |
849 | button_set_flip(global_settings.flip_display); | 849 | button_set_flip_vertically(global_settings.flip_display); |
850 | #endif | 850 | #endif |
851 | lcd_update(); /* refresh after flipping the screen */ | 851 | lcd_update(); /* refresh after flipping the screen */ |
852 | settings_apply_pm_range(); | 852 | settings_apply_pm_range(); |