elm_panel: scrollable panel content size ratio refactoring (for 2.4 UX) 88/165088/2
authorJeonghyun Yun <jh0506.yun@samsung.com>
Tue, 26 Dec 2017 05:22:53 +0000 (14:22 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Tue, 26 Dec 2017 05:25:04 +0000 (05:25 +0000)
@tizen_feature

Change-Id: I9acedea6a41e6948e75b1c8d9c46fa4577d39774
Signed-off-by: Jeonghyun Yun <jh0506.yun@samsung.com>
src/lib/elementary/elm_panel.c
src/lib/elementary/elm_panel.eo
src/lib/elementary/elm_widget_panel.h

index 57a3a47..b5d0b93 100644 (file)
@@ -836,6 +836,12 @@ _elm_panel_efl_canvas_group_group_add(Eo *obj, Elm_Panel_Data *priv)
    elm_widget_can_focus_set(obj, EINA_TRUE);
 
    priv->panel_edje = wd->resize_obj;
+   // TIZEN_ONLY(20170105): scrollable panel content size ratio refactoring (for 2.4 UX)
+   if ((elm_win_rotation_get(elm_widget_top_get(obj)) == 90) || (elm_win_rotation_get(elm_widget_top_get(obj)) == 270))
+     priv->content_size_ratio = 0.45;
+   else
+     priv->content_size_ratio = 0.80;
+   //
 
    efl_ui_widget_theme_apply(obj);
 
@@ -957,6 +963,28 @@ _elm_panel_efl_canvas_group_group_member_add(Eo *obj, Elm_Panel_Data *sd, Evas_O
    if (sd->hit_rect) evas_object_raise(sd->hit_rect);
 }
 
+// TIZEN_ONLY(20170105): scrollable panel content size ratio refactoring (for 2.4 UX)
+EOLIAN static void
+_elm_panel_efl_orientation_orientation_set(Eo *obj, Elm_Panel_Data *sd, Efl_Orient orient)
+{
+   if (!sd->content_size_manual_set)
+     {
+        if (orient == EFL_ORIENT_90 || orient == EFL_ORIENT_270)
+          sd->content_size_ratio = 0.45;
+        else
+          sd->content_size_ratio = 0.80;
+     }
+
+   if (sd->scrollable)
+     {
+        Evas_Coord w, h;
+        evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+
+        _scrollable_layout_resize(obj, sd, w, h);
+     }
+}
+//
+
 EOLIAN static void
 _elm_panel_elm_widget_on_access_update(Eo *obj, Elm_Panel_Data *_pd, Eina_Bool is_access)
 {
@@ -1032,7 +1060,13 @@ _elm_panel_orient_set(Eo *obj, Elm_Panel_Data *sd, Elm_Panel_Orient orient)
              elm_layout_signal_emit(sd->scr_ly, "elm,state,content,hidden", "elm");
           }
 
-        elm_panel_scrollable_content_size_set(obj, sd->content_size_ratio);
+        // TIZEN_ONLY(20170105): scrollable panel content size ratio refactoring (for 2.4 UX)
+        //elm_panel_scrollable_content_size_set(obj, sd->content_size_ratio);
+        Evas_Coord w, h;
+        evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+
+        _scrollable_layout_resize(obj, sd, w, h);
+        //
      }
    else
      _orient_set_do(obj);
@@ -1293,6 +1327,9 @@ _elm_panel_scrollable_content_size_set(Eo *obj, Elm_Panel_Data *sd, double ratio
    else if (ratio > 1.0) ratio = 1.0;
 
    sd->content_size_ratio = ratio;
+   // TIZEN_ONLY(20170105): scrollable panel content size ratio refactoring (for 2.4 UX)
+   sd->content_size_manual_set = EINA_TRUE;
+   //
 
    if (sd->scrollable)
      {
@@ -1379,6 +1416,13 @@ _elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool scrollable)
         elm_layout_content_set(sd->scr_ly, "elm.swallow.content", sd->bx);
         if (sd->content) elm_widget_sub_object_add(sd->scr_ly, sd->content);
 
+        // TIZEN_ONLY(20170105): scrollable panel content size ratio refactoring (for 2.4 UX)
+        Evas_Coord w, h;
+        evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+
+        _scrollable_layout_resize(obj, sd, w, h);
+        //
+
         switch (sd->orient)
           {
            case ELM_PANEL_ORIENT_TOP:
index eeebe5a..ca5091f 100644 (file)
@@ -9,6 +9,9 @@ enum Elm.Panel.Orient
 }
 
 class Elm.Panel (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Elm.Interface_Scrollable,
+                 // TIZEN_ONLY(20170105): scrollable panel content size ratio refactoring (for 2.4 UX)
+                 Efl.Orientation,
+                 //
                  Efl.Access.Widget.Action)
 {
    [[Elementary panel class]]
@@ -78,6 +81,9 @@ class Elm.Panel (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Elm.Interface_Scrollable,
       Efl.Object.constructor;
       Efl.Gfx.position { set; }
       Efl.Gfx.size { set; }
+      // TIZEN_ONLY(20170105): scrollable panel content size ratio refactoring (for 2.4 UX)
+      Efl.Orientation.orientation { set; }
+      //
       Efl.Canvas.Group.group_member_add;
       Elm.Widget.theme_apply;
       Elm.Widget.on_disabled_update;
index 1684748..ce5f8ec 100644 (file)
@@ -46,6 +46,9 @@ struct _Elm_Panel_Data
    Eina_Bool                             delete_me : 1;
    Eina_Bool                             scrollable : 1;
    Eina_Bool                             freeze: 1;
+   // TIZEN_ONLY(20170105): scrollable panel content size ratio refactoring (for 2.4 UX)
+   Eina_Bool                             content_size_manual_set: 1;
+   //
 };
 
 /**