From 60c26bc0c0a5fcafdf98e2486984046286bc1bde Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Thu, 20 Jun 2013 21:27:45 +0900 Subject: [PATCH] Fix JIRA issue (N_SE-42183) Set the initial rotate moe Change-Id: I0e635ef3568995951b2c0e8b52a3e87ba31fcafc --- src/ui/bt-main-ug.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/ui/bt-main-ug.c b/src/ui/bt-main-ug.c index 2a208e4..ffe4b5e 100644 --- a/src/ui/bt-main-ug.c +++ b/src/ui/bt-main-ug.c @@ -233,6 +233,44 @@ static void __bt_ug_release_memory(bt_ug_data *ugd) FN_END; } +void __bt_ug_set_rotation(Evas_Object *win) +{ + FN_START; + + enum appcore_rm curr; + int rotate = 0; + + if (appcore_get_rotation_state(&curr) < 0) { + BT_ERR("Fail to get rotation"); + return; + } + + switch (curr) { + case APPCORE_RM_PORTRAIT_NORMAL: + rotate = 0; + break; + case APPCORE_RM_PORTRAIT_REVERSE: + rotate = 180; + break; + case APPCORE_RM_LANDSCAPE_NORMAL: + rotate = 90; + break; + case APPCORE_RM_LANDSCAPE_REVERSE: + rotate = 270; + break; + default: + BT_ERR("Unknown value"); + return; + } + + BT_DBG("rotate: %d", rotate); + + elm_win_rotation_with_resize_set(win, rotate); + + FN_END; +} + + static void *__on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv) { @@ -254,6 +292,8 @@ static void *__on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, if (!ugd->win_main) return NULL; + __bt_ug_set_rotation(ugd->win_main); + if (mode == UG_MODE_FULLVIEW) { ugd->base = __bt_create_fullview(ugd->win_main, ugd); bg = _bt_create_bg(ugd->win_main, "group_list"); -- 2.7.4