elementary/naviframe - consider the min size
authorhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 20 Nov 2011 06:31:54 +0000 (06:31 +0000)
committerhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 20 Nov 2011 06:31:54 +0000 (06:31 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@65421 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

data/themes/widgets/naviframe.edc
src/lib/elc_naviframe.c

index f5efbce..f49f9fc 100644 (file)
@@ -111,6 +111,7 @@ group { name:"elm/naviframe/item/basic/default";
          description { state: "default" 0.0;
             min: 40 40;
             max: 40 40;
+           fixed: 1 1;
             align: 1 0.5;
             rel1.to: "elm.text.title";
             rel1.relative: 0 0;
index 5bd1ebe..13d05b3 100644 (file)
@@ -41,6 +41,8 @@ struct _Elm_Naviframe_Item
    Evas_Object       *title_next_btn;
    Evas_Object       *icon;
    const char        *style;
+   Evas_Coord         minw;
+   Evas_Coord         minh;
    Eina_Bool          back_btn: 1;
    Eina_Bool          title_visible: 1;
 };
@@ -439,11 +441,18 @@ _sizing_eval(Evas_Object *obj)
 {
    Widget_Data *wd;
    Elm_Naviframe_Item *it;
+   Evas_Coord minw = -1, minh = -1;
    wd  = elm_widget_data_get(obj);
    if (!wd) return;
 
    EINA_INLIST_FOREACH(wd->stack, it)
-     _item_sizing_eval(it);
+     {
+        _item_sizing_eval(it);
+        if (it->minw > minw) minw = it->minw;
+        if (it->minh > minh) minh = it->minh;
+     }
+   evas_object_size_hint_min_set(obj, minw, minh);
+   evas_object_size_hint_max_set(obj, -1, -1);
 }
 
 static void
@@ -459,6 +468,7 @@ _item_sizing_eval(Elm_Naviframe_Item *it)
    evas_object_geometry_get(WIDGET(it), &x, &y, &w, &h);
    evas_object_move(VIEW(it), x, y);
    evas_object_resize(VIEW(it), w, h);
+   edje_object_size_min_calc(VIEW(it), &it->minw, &it->minh);
 }
 
 static void