Efl: Introduce combine_min size hint

It combines the content min size and the requested min size
by taking the MAX value. This will help support request size
without major code changes.
This commit is contained in:
Jean-Philippe Andre 2016-06-08 20:24:59 +09:00
parent e38cf1f85f
commit b40b4042f0
3 changed files with 30 additions and 0 deletions

View File

@ -121,6 +121,22 @@ interface Efl.Gfx.Size.Hint
h: int; [[Integer to use as the minimum height hint.]]
}
}
@property hint_combined_min {
[[Read-only minimum size combining both @.hint_content_min and
@.hint_request size hints.
@.hint_content_min is intended for mostly internal usage
and widget developers, and @.hint_request is intended to be
set from application side. @.hint_combined_min combines both values
by taking their repective maximum (in both width and height), and
is used internally to get an object's minimum size.
]]
get {}
values {
w: int; [[Integer to use as the minimum width hint.]]
h: int; [[Integer to use as the minimum height hint.]]
}
}
@property hint_margin {
[[Hints for an object's margin or padding space.

View File

@ -902,6 +902,7 @@ abstract Evas.Object (Eo.Base, Evas.Common_Interface, Efl.Gfx, Efl.Gfx.Stack,
Efl.Gfx.Size.Hint.hint_aspect.get;
Efl.Gfx.Size.Hint.hint_align.set;
Efl.Gfx.Size.Hint.hint_align.get;
Efl.Gfx.Size.Hint.hint_combined_min.get;
Efl.Gfx.Size.Hint.hint_content_min.set;
Efl.Gfx.Size.Hint.hint_content_min.get;
Efl.Gfx.Size.Hint.hint_max.set;

View File

@ -1131,6 +1131,19 @@ _evas_object_efl_gfx_size_hint_hint_content_min_set(Eo *eo_obj, Evas_Object_Prot
evas_object_inform_call_changed_size_hints(eo_obj);
}
EOLIAN static void
_evas_object_efl_gfx_size_hint_hint_combined_min_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *w, Evas_Coord *h)
{
if ((!obj->size_hints) || obj->delete_me)
{
if (w) *w = 0;
if (h) *h = 0;
return;
}
if (w) *w = MAX(obj->size_hints->min.w, obj->size_hints->request.w);
if (h) *h = MAX(obj->size_hints->min.h, obj->size_hints->request.h);
}
EOLIAN static void
_evas_object_efl_gfx_size_hint_hint_max_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *w, Evas_Coord *h)
{