From 60afe0f936fa80ed83bcd9b9426c808ab5e7b6e1 Mon Sep 17 00:00:00 2001 From: Denis Dolzhenko Date: Wed, 18 Oct 2017 15:08:02 +0300 Subject: [PATCH] TizenRefApp-8613 [RTL] Wrong scroll direction in Task Manager Change-Id: I654d08f805d73c5b24758c2c615486502bf235e7 Signed-off-by: Denis Dolzhenko --- src/App/inc/App.h | 2 ++ src/App/src/App.cpp | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/App/inc/App.h b/src/App/inc/App.h index 20a312e..072f547 100644 --- a/src/App/inc/App.h +++ b/src/App/inc/App.h @@ -44,6 +44,8 @@ namespace TaskMngr { App(App &) = delete; App &operator=(App &) = delete; + void updateCharacterOrientation(); + // App cbs: bool onCreate(); void onTerminate(); diff --git a/src/App/src/App.cpp b/src/App/src/App.cpp index 265e0c6..a6a327f 100644 --- a/src/App/src/App.cpp +++ b/src/App/src/App.cpp @@ -22,6 +22,8 @@ #include "MainController.h" #include +#include +#include using namespace TaskMngr; @@ -86,6 +88,27 @@ int App::start(int argc, char *argv[]) return ui_app_main(argc, argv, &cbs, this); } +void App::updateCharacterOrientation() +{ + char *lang = nullptr; + system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &lang); + if (lang) { + LOG("Language: ", lang); + elm_language_set(lang); + i18n_ulocale_layout_type_e layout = I18N_ULOCALE_LAYOUT_UNKNOWN; + if (i18n_ulocale_get_character_orientation(lang, &layout) == I18N_ERROR_NONE) { + if (layout == I18N_ULOCALE_LAYOUT_LTR) { + elm_config_mirrored_set(false); + } else if (layout == I18N_ULOCALE_LAYOUT_RTL) { + elm_config_mirrored_set(true); + } else { + LOG_ERROR("Unsupported character orientation type: ", layout); + } + } + free(lang); + } +} + bool App::onCreate() { TRACE; @@ -99,6 +122,7 @@ bool App::onCreate() elm_app_base_scale_set(1.3); elm_config_accel_preference_set("3d"); ecore_animator_frametime_set(1 / maxFps); + updateCharacterOrientation(); m_pWindow = new Window; m_pWindow->show(); @@ -145,6 +169,7 @@ void App::onControl(app_control_h app_control) void App::onLanguageChanged(app_event_info_h appEvent) { TRACE; + updateCharacterOrientation(); } void App::onLowBattery(app_event_info_h appEvent) -- 2.7.4