if (sd->vertical)
{
- evas_object_resize(sd->bx, w, vh);
+ h = vh;
_items_visibility_fix(sd, &ih, vh, &more);
}
else
{
- evas_object_resize(sd->bx, vw, h);
+ w = vw;
_items_visibility_fix(sd, &iw, vw, &more);
}
evas_object_geometry_get
if (sd->vertical)
{
- evas_object_resize(sd->bx, w, vh);
+ h = vh;
_items_visibility_fix(sd, &ih, vh, &more);
}
else
{
- evas_object_resize(sd->bx, vw, h);
+ w = vw;
_items_visibility_fix(sd, &iw, vw, &more);
}
evas_object_box_remove_all(sd->bx, EINA_FALSE);
{
Evas_Coord iw = 0, ih = 0;
- if ((vw >= mw) && (vh >= mh))
- evas_object_resize(sd->bx, vw, vh);
- else if (vw < mw)
- evas_object_resize(sd->bx, mw, vh);
- else if (vh < mh)
- evas_object_resize(sd->bx, vw, mh);
+ if (sd->vertical)
+ h = (vh >= mh) ? vh : mh;
+ else
+ w = (vw >= mw) ? vw : mw;
if (sd->vertical)
_items_visibility_fix(sd, &ih, vh, &more);
{
if (sd->vertical)
{
- if ((vh >= mh) && (h != vh)) evas_object_resize(sd->bx, w, vh);
+ if ((vh >= mh) && (h != vh)) h = vh;
}
else
{
- if ((vw >= mw) && (w != vw)) evas_object_resize(sd->bx, vw, h);
+ if ((vw >= mw) && (w != vw)) w = vw;
}
EINA_INLIST_FOREACH(sd->items, it)
{
}
}
+ if (sd->transverse_expanded)
+ {
+ if (sd->vertical)
+ w = vw;
+ else
+ h = vh;
+ }
+
+ evas_object_resize(sd->bx, w, h);
+
// Remove the first or last separator since it is not neccessary
list = evas_object_box_children_get(sd->bx_more);
EINA_INLIST_FOREACH(sd->items, it)
{
minw = minw_bx + (w - vw);
minh = minh_bx + (h - vh);
- if (minw_bx < vw) minw_bx = vw;
- if (minh_bx < vh) minh_bx = vh;
+ if (sd->vertical)
+ {
+ if (minh_bx < vh) minh_bx = vh;
+ }
+ else
+ {
+ if (minw_bx < vw) minw_bx = vw;
+ }
}
else
{
}
}
+ if (sd->transverse_expanded)
+ {
+ if (sd->vertical)
+ minw_bx = vw;
+ else
+ minh_bx = vh;
+ }
+
evas_object_resize(sd->bx, minw_bx, minh_bx);
- evas_object_resize(sd->more, w, h);
+ evas_object_resize(sd->more, minw_bx, minh_bx);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, -1, -1);
}
EAPI void
+elm_toolbar_transverse_expanded_set(Evas_Object *obj, Eina_Bool transverse_expanded)
+{
+ ELM_TOOLBAR_CHECK(obj);
+ ELM_TOOLBAR_DATA_GET(obj, sd);
+
+ if (sd->transverse_expanded == transverse_expanded) return;
+ sd->transverse_expanded = transverse_expanded;
+
+ _sizing_eval(obj);
+}
+
+EAPI Eina_Bool
+elm_toolbar_transverse_expanded_get(const Evas_Object *obj)
+{
+ ELM_TOOLBAR_CHECK(obj) EINA_FALSE;
+ ELM_TOOLBAR_DATA_GET(obj, sd);
+
+ return sd->transverse_expanded;
+}
+
+EAPI void
elm_toolbar_homogeneous_set(Evas_Object *obj,
Eina_Bool homogeneous)
{
EAPI Elm_Toolbar_Shrink_Mode elm_toolbar_shrink_mode_get(const Evas_Object *obj);
/**
+ * Set the item's transverse expansion of a given toolbar widget @p obj.
+ *
+ * @param obj The toolbar object.
+ * @param transverse_expanded The transverse expansion of the item.
+ * (EINA_TRUE = on, EINA_FALSE = off, default = EINA_FALSE)
+ *
+ * This will expand the transverse length of the item according the transverse length of the toolbar.
+ * The default is what the transverse length of the item is set according its min value.
+ *
+ * @ingroup Toolbar
+ */
+EAPI void elm_toolbar_transverse_expanded_set(Evas_Object *obj, Eina_Bool transverse_expanded);
+
+/**
+ * Get the transverse expansion of toolbar @p obj.
+ *
+ * @param obj The toolbar object.
+ * @return The transverse expansion of the item.
+ * (EINA_TRUE = on, EINA_FALSE = off, default = EINA_FALSE)
+ *
+ * @see elm_toolbar_transverse_expand_set() for details.
+ *
+ * @ingroup Toolbar
+ */
+EAPI Eina_Bool elm_toolbar_transverse_expanded_get(const Evas_Object *obj);
+
+/**
* Enable/disable homogeneous mode.
*
* @param obj The toolbar object