the clicked area */
ELM_CTXPOPUP_DIRECTION_UP, /**< ctxpopup show appear above the clicked
area */
+ ELM_CTXPOPUP_DIRECTION_DONT_KNOW, /**< ctxpopup does not determine it's direction yet*/
} Elm_Ctxpopup_Direction;
/**
* @see elm_ctxpopup_direction_priority_set() for more information.
*/
EAPI void elm_ctxpopup_direction_priority_get(Evas_Object *obj, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth) EINA_ARG_NONNULL(1);
+
+ /**
+ * @brief Get the current direction of a ctxpopup.
+ *
+ * @param obj Ctxpopup object
+ * @return current direction of a ctxpopup
+ *
+ * @warning Once the ctxpopup showed up, the direction would be determined
+ */
+ EAPI Elm_Ctxpopup_Direction elm_ctxpopup_direction_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+
/**
* @}
*/
if (!wd) return;
+ wd->dir = ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
+
if (wd->visible)
{
_scroller_size_reset(wd);
if (!wd) return;
+ wd->dir = ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
+
if (wd->visible)
{
_scroller_size_reset(wd);
wd = elm_widget_data_get(obj);
if (!wd) return;
+ wd->dir = ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
+
if (wd->visible)
_sizing_eval(obj);
}
Evas_Coord_Rectangle hover_area;
Evas_Coord_Rectangle parent_size;
Evas_Coord_Point arrow_size;
- Elm_Ctxpopup_Direction dir = ELM_CTXPOPUP_DIRECTION_DOWN;
+ Elm_Ctxpopup_Direction dir = ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
Evas_Coord_Point temp;
int idx;
{
switch (wd->dir_priority[idx])
{
+ case ELM_CTXPOPUP_DIRECTION_DONT_KNOW:
case ELM_CTXPOPUP_DIRECTION_UP:
temp.y = (pos.y - base_size.y);
if ((temp.y - arrow_size.y) < hover_area.y)
elm_object_style_set(wd->scr, elm_object_style_get(obj));
}
+ wd->dir = ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
+
if (wd->visible)
{
_scroller_size_reset(wd);
wd->content = content;
+ wd->dir = ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
+
if (wd->visible)
_sizing_eval(obj);
}
edje_object_signal_emit(wd->base, "elm,state,content,disable", "elm");
wd->content = NULL;
+ wd->dir = ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
return content;
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
evas_object_resize(wd->bg, w, h);
+ wd->dir = ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
if (!wd->visible) return;
wd->dir_priority[1] = ELM_CTXPOPUP_DIRECTION_LEFT;
wd->dir_priority[2] = ELM_CTXPOPUP_DIRECTION_RIGHT;
wd->dir_priority[3] = ELM_CTXPOPUP_DIRECTION_DOWN;
+ wd->dir = ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE, _parent_resize,
obj);
if (!wd) return;
_item_icon_set(ctxpopup_it, icon);
+ wd->dir = ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
if (wd->visible)
{
if (!wd) return;
_item_label_set(ctxpopup_it, label);
+ wd->dir = ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
if (wd->visible)
{
_remove_items(wd);
_list_del(wd);
+ wd->dir = ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
}
EAPI void
elm_scroller_bounce_set(wd->scr, EINA_TRUE, EINA_FALSE);
}
+ wd->dir = ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
+
if (wd->visible)
_sizing_eval(obj);
}
_item_label_set(item, label);
elm_box_pack_end(wd->box, item->base.view);
wd->items = eina_list_append(wd->items, item);
+ wd->dir = ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
if (wd->visible)
{
if (eina_list_count(wd->items) < 1)
wd->items = NULL;
+ wd->dir = ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
+
if (wd->visible)
_sizing_eval(ctxpopup_it->base.widget);
if (third) *third = wd->dir_priority[2];
if (fourth) *fourth = wd->dir_priority[3];
}
+
+EAPI Elm_Ctxpopup_Direction
+elm_ctxpopup_direction_get(const Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
+ Widget_Data *wd;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd) return ELM_CTXPOPUP_DIRECTION_DONT_KNOW;
+ return wd->dir;
+}