ctxpopup: fix 'more' style problem. remove white space, fix landscape and size bug 63/65663/3
authorJinyong Park <j4939.park@samsung.com>
Tue, 12 Apr 2016 05:27:57 +0000 (14:27 +0900)
committerJinyong Park <j4939.park@samsung.com>
Tue, 12 Apr 2016 08:38:50 +0000 (17:38 +0900)
Change-Id: I0040424f396f735492eb02881e485bcc6d4339dc
Signed-off-by: Jinyong Park <j4939.park@samsung.com>
src/lib/elc_ctxpopup.c

index 120afc66dba161912731fb73c214bdc5e0174828..e0f4162f79a3c8b41e2c1319b60a03f749b14de2 100644 (file)
@@ -9,6 +9,9 @@
 #include <Elementary.h>
 
 #include "elm_priv.h"
+//TIZEN_ONLY(20160412): fix 'more' style size problem
+#include "elm_interface_scrollable.h"
+//
 #include "elm_widget_ctxpopup.h"
 
 #define MY_CLASS ELM_CTXPOPUP_CLASS
@@ -206,6 +209,11 @@ _base_geometry_calc(Evas_Object *obj,
    Evas_Coord_Point max_size;
    Evas_Coord_Point min_size;
    Evas_Coord_Point temp;
+   //TIZEN_ONLY(20160412): fix 'more' style size problem
+   Evas_Coord maxh = 0;
+   Evas_Coord scrh = 0;
+   const char *str = NULL;
+   //
    int idx;
 
    ELM_CTXPOPUP_DATA_GET(obj, sd);
@@ -234,14 +242,43 @@ _base_geometry_calc(Evas_Object *obj,
    //Limit to Max Size
    evas_object_size_hint_max_get(obj, &max_size.x, &max_size.y);
 
+   //TIZEN_ONLY(20160412): fix 'more' style size problem
+   if (sd->list && sd->list_visible)
+     {
+        eo_do(sd->list, elm_interface_scrollable_content_size_get(NULL, &scrh));
+        if (base_size.y < scrh)
+          base_size.y = scrh;
+     }
+   //
+
    if ((max_size.y > 0) && (base_size.y > max_size.y))
      base_size.y = max_size.y;
 
    if ((max_size.x > 0) && (base_size.x > max_size.x))
      base_size.x = max_size.x;
+
+   //TIZEN_ONLY(20160412): fix 'more' style size problem
+   if ((wd->orient_mode == 90) || (wd->orient_mode == 270))
+     str = edje_object_data_get(elm_layout_edje_get(obj), "visible_landscape_maxh");
+
+   if (!str) str = edje_object_data_get(elm_layout_edje_get(obj), "visible_maxh");
+
+   if (str) maxh = (int)(atoi(str)
+                         * elm_config_scale_get() * elm_object_scale_get(obj)
+                         / edje_object_base_scale_get(elm_layout_edje_get(obj)));
+
+   if ((maxh > 0) && (base_size.y > maxh))
+     base_size.y = maxh;
+   //
+
    //Limit to Min Size
    evas_object_size_hint_min_get(obj, &min_size.x, &min_size.y);
 
+   //TIZEN_ONLY(20160412): fix 'more' style size problem
+   if ((min_size.y > 0) && (min_size.y > maxh))
+     min_size.y = maxh;
+   //
+
    if ((min_size.y > 0) && (base_size.y < min_size.y))
      base_size.y = min_size.y;
 
@@ -976,6 +1013,11 @@ _on_show(void *data EINA_UNUSED,
          * that seems to be spread all over Elementary.
          */
         //elm_object_focus_set(sd->list, EINA_TRUE);
+
+        //TIZEN_ONLY(20160412): fix 'more' style size problem
+        elm_layout_sizing_eval(obj);
+        //
+
         return;
      }