[*][ctxpopup] compress item
authorShinwoo Kim <cinoo.kim@samsung.com>
Mon, 10 Oct 2011 11:14:54 +0000 (20:14 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Tue, 11 Oct 2011 02:15:49 +0000 (11:15 +0900)
Change-Id: I2d1b6ab61097a699db3fee8815c29be61eb174b3

src/lib/elc_ctxpopup.c

index c667b55..9510106 100644 (file)
@@ -583,6 +583,23 @@ _update_arrow(Evas_Object *obj, Elm_Ctxpopup_Direction dir)
    evas_object_move(wd->arrow, arrow_size.x, arrow_size.y);
 }
 
+//TODO: compress item - different from opensource
+static void
+_compress_item(Evas_Object *obj)
+{
+   Widget_Data *wd;
+   Eina_List *elist;
+   Elm_Ctxpopup_Item *item;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd) return;
+
+   EINA_LIST_FOREACH(wd->items, elist, item)
+     {
+           edje_object_signal_emit(item->base.view, "elm,state,compress", "elm");
+     }
+}
+
 static void
 _sizing_eval(Evas_Object *obj)
 {
@@ -625,6 +642,11 @@ _sizing_eval(Evas_Object *obj)
 
    //Base
    wd->dir = _calc_base_geometry(obj, &rect);
+
+   //TODO: compress item - different from opensource
+   if (!wd->horizontal && !wd->content)
+      _compress_item(obj);
+
    _update_arrow(obj, wd->dir);
    _shift_base_by_arrow(wd->arrow, wd->dir, &rect);