[ctxpopup] fixed bug for N_SE-27154
[framework/uifw/elementary.git] / src / lib / elc_ctxpopup.c
index 20bab36..6790017 100644 (file)
@@ -28,17 +28,18 @@ _elm_ctxpopup_smart_focus_next(const Evas_Object *obj,
    if (!sd)
      return EINA_FALSE;
 
-   if (!elm_widget_focus_next_get(sd->box, dir, next))
+   if (eina_list_count(sd->items))
      {
-        elm_widget_focused_object_clear(sd->box);
-        elm_widget_focus_next_get(sd->box, dir, next);
-     }
-
-   EINA_LIST_FOREACH(sd->items, elist, it)
-     items = eina_list_append(items, it->base.access_obj);
+        EINA_LIST_FOREACH(sd->items, elist, it)
+          items = eina_list_append(items, it->base.access_obj);
 
-   return elm_widget_focus_list_next_get
-            (obj, items, eina_list_data_get, dir, next);
+        return elm_widget_focus_list_next_get
+                 (obj, items, eina_list_data_get, dir, next);
+     }
+   else
+     {
+        return elm_widget_focus_next_get(sd->box, dir, next);
+     }
 }
 
 static Eina_Bool
@@ -803,6 +804,8 @@ _elm_ctxpopup_smart_sizing_eval(Evas_Object *obj)
    Evas_Coord_Rectangle rect = { 0, 0, 1, 1 };
    Evas_Coord_Point box_size = { 0, 0 };
    Evas_Coord_Point _box_size = { 0, 0 };
+   Evas_Coord maxw = 0;
+   const char *str;
 
    ELM_CTXPOPUP_DATA_GET(obj, sd);
 
@@ -811,6 +814,20 @@ _elm_ctxpopup_smart_sizing_eval(Evas_Object *obj)
      {
         _item_sizing_eval(item);
         evas_object_size_hint_min_get(VIEW(item), &_box_size.x, &_box_size.y);
+
+        str = edje_object_data_get(VIEW(item), "item_max_size");
+        if (str)
+          {
+             maxw = atoi(str);
+             maxw = maxw * elm_widget_scale_get(obj) * elm_config_scale_get();
+
+             if (_box_size.x > maxw)
+               {
+                  edje_object_signal_emit(VIEW(item), "elm,state,text,ellipsis", "elm");
+                  edje_object_message_signal_process(VIEW(item));
+               }
+          }
+
         if (!sd->horizontal)
           {
              if (_box_size.x > box_size.x)