_sizing_eval(Evas_Object *obj, Elm_Layout_Smart_Data *sd)
{
Evas_Coord minh = -1, minw = -1;
+ Evas_Coord rest_w = 0, rest_h = 0;
ELM_WIDGET_DATA_GET_OR_RETURN(sd->obj, wd);
- edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
+ if (sd->restricted_calc_w)
+ rest_w = wd->w;
+ if (sd->restricted_calc_h)
+ rest_h = wd->h;
+
+ edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh,
+ rest_w, rest_h);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, -1, -1);
+
+ sd->restricted_calc_w = sd->restricted_calc_h = EINA_FALSE;
}
/* common content cases for layout objects: icon and text */
evas_object_smart_changed(obj);
}
+EAPI void
+elm_layout_sizing_restricted_eval(Evas_Object *obj, Eina_Bool w, Eina_Bool h)
+{
+ ELM_LAYOUT_CHECK(obj);
+ eo_do(obj, elm_obj_layout_sizing_restricted_eval(w, h));
+}
+
+static void
+_elm_layout_smart_sizing_restricted_eval(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Layout_Smart_Data *sd = _pd;
+ Eina_Bool w = va_arg(*list, int);
+ Eina_Bool h = va_arg(*list, int);
+
+ sd->restricted_calc_w = !!w;
+ sd->restricted_calc_h = !!h;
+
+ evas_object_smart_changed(obj);
+}
+
EAPI int
elm_layout_freeze(Evas_Object *obj)
{
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_EDJE_GET), _elm_layout_smart_edje_get),
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_DATA_GET), _elm_layout_smart_data_get),
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_layout_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_RESTRICTED_EVAL), _elm_layout_smart_sizing_restricted_eval),
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_SET), _elm_layout_smart_part_cursor_set),
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_GET), _elm_layout_smart_part_cursor_get),
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_UNSET), _elm_layout_smart_part_cursor_unset),
EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_THEME_ENABLE, "Checks whenever 'theme' is impemented in current class."),
EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_FREEZE, "Freezes the Elementary layout object."),
EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_THAW, "Thaws the Elementary layout object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_SIZING_RESTRICTED_EVAL, "Eval sizing, restricted to current width/height size."),
EO_OP_DESCRIPTION_SENTINEL
ELM_OBJ_LAYOUT_SUB_ID_THEME_ENABLE,
ELM_OBJ_LAYOUT_SUB_ID_FREEZE,
ELM_OBJ_LAYOUT_SUB_ID_THAW,
+ ELM_OBJ_LAYOUT_SUB_ID_SIZING_RESTRICTED_EVAL,
ELM_OBJ_LAYOUT_SUB_ID_LAST
};
#define elm_obj_layout_sizing_eval() ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL)
/**
+ * @def elm_obj_layout_sizing_restricted_eval
+ * @since 1.8
+ *
+ * Eval sizing, restricted to current width and/or height
+ *
+ * @see elm_layout_sizing_restricted_eval
+ */
+#define elm_obj_layout_sizing_restricted_eval(width, height) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_RESTRICTED_EVAL), EO_TYPECHECK(Eina_Bool, width), EO_TYPECHECK(Eina_Bool, height)
+
+/**
* @def elm_obj_layout_part_cursor_set
* @since 1.8
*
EAPI void elm_layout_sizing_eval(Evas_Object *obj);
/**
+ * Request sizing reevaluation, restricted to current width and/or height
+ *
+ * Useful mostly when there are TEXTBLOCK parts defining the height of the
+ * object and nothing else restricting it to a minimum width. Calling this
+ * function will restrict the minimum size in the Edje calculation to whatever
+ * size it the layout has at the moment.
+ *
+ * @param obj The layout object
+ * @param w Restrict minimum size to the current width
+ * @param h Restrict minimum size ot the current height
+ *
+ * @since 1.8
+ *
+ * @ingroup Layout
+ */
+EAPI void elm_layout_sizing_restricted_eval(Evas_Object *obj, Eina_Bool w, Eina_Bool h);
+
+/**
* Sets a specific cursor for an edje part.
*
* @param obj The layout object.