popup: fix popup size problem in landscape display mode 01/161701/8
authorJinYong Park <j4939.park@samsung.com>
Mon, 27 Nov 2017 04:03:16 +0000 (13:03 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Wed, 3 Jan 2018 07:18:03 +0000 (07:18 +0000)
origin patch : https://review.tizen.org/gerrit/#/c/64773/

Change-Id: I1fff057746d06d5a239a5d21cc5518ff75e4616e
Signed-off-by: JinYong Park <j4939.park@samsung.com>
src/lib/elementary/elc_popup.c

index 5a236cb..8032ae3 100644 (file)
@@ -727,6 +727,11 @@ _elm_popup_elm_layout_sizing_eval(Eo *obj, Elm_Popup_Data *sd)
      {
         double horizontal, vertical;
         Evas_Coord w, h;
+        /* TIZEN_ONLY(20160405): fix popup size problem in landscape mode */
+        int rotation = -1;
+        int w_content_area = 9999;
+        const char *str;
+        /* END */
 
         edje_object_message_signal_process(elm_layout_edje_get(sd->content_area));
 
@@ -738,10 +743,25 @@ _elm_popup_elm_layout_sizing_eval(Eo *obj, Elm_Popup_Data *sd)
           h = sd->max_sc_h;
         /* END */
 
+        /* TIZEN_ONLY(20160405): fix popup size problem in landscape mode */
+        str = edje_object_data_get(elm_layout_edje_get(sd->content_area), "content_area_wdith");
+        if (str) w_content_area = (int)(atoi(str)
+                                    * elm_config_scale_get()
+                                    * elm_object_scale_get(obj)
+                                    / edje_object_base_scale_get(elm_layout_edje_get(sd->content_area)));
+        /* END */
+
         if (EINA_DBL_EQ(horizontal, ELM_NOTIFY_ALIGN_FILL))
           minw = w;
         if (EINA_DBL_EQ(vertical, ELM_NOTIFY_ALIGN_FILL))
           minh = h;
+
+        /* TIZEN_ONLY(20160405): fix popup size problem in landscape mode */
+        rotation = elm_win_rotation_get(elm_widget_top_get(elm_widget_parent_get(sd->notify)));
+        if ((rotation == 90 || rotation == 270) && (horizontal == ELM_NOTIFY_ALIGN_FILL))
+          minw = w_content_area;
+        /* END */
+
         edje_object_size_min_restricted_calc(elm_layout_edje_get(sd->content_area),
                                              &minw, &minh, minw, minh);