[elm_multibuttonentry]CQ:H0100135430- Added recalc_entry_geometry() to be scrolled...
authorGoun Lee <gouni.lee@samsung.com>
Mon, 24 Oct 2011 11:39:26 +0000 (20:39 +0900)
committerGoun Lee <gouni.lee@samsung.com>
Mon, 24 Oct 2011 11:47:57 +0000 (20:47 +0900)
src/lib/elm_multibuttonentry.c

index d798297..aafd2b6 100644 (file)
@@ -105,6 +105,7 @@ static void _set_vis_guidetext(Evas_Object *obj);
 static void _calculate_box_min_size(Evas_Object *box, Evas_Object_Box_Data *priv);
 static Evas_Coord _calculate_item_max_height(Evas_Object *box, Evas_Object_Box_Data *priv, int obj_index);
 static void _box_layout_cb(Evas_Object *o, Evas_Object_Box_Data *priv, void *data);
+static void _recalc_entry_geometry(Evas_Object *obj);
 
 static void
 _del_hook(Evas_Object *obj)
@@ -905,6 +906,7 @@ _add_button_item(Evas_Object *obj, const char *str, Multibuttonentry_Pos pos, co
           }
      }
    evas_object_smart_callback_call(obj, "item,added", item);
+   _recalc_entry_geometry(obj);
 
    free(str_utf8);
 
@@ -1114,6 +1116,20 @@ _view_init(Evas_Object *obj)
 }
 
 static void
+_recalc_entry_geometry(Evas_Object *obj)
+{
+   Evas_Coord cx, cy, cw, ch;
+
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+
+   if (!elm_object_focus_get(obj)) return;
+
+   evas_object_geometry_get(wd->entry, &cx, &cy, &cw, &ch);
+   elm_widget_show_region_set(obj, cx, cy, cw, ch, EINA_FALSE);
+}
+
+static void
 _calculate_box_min_size(Evas_Object *box, Evas_Object_Box_Data *priv)
 {
    Evas_Coord minw, minh, maxw, maxh, mnw, mnh, ww;