From 79a5ff6e1e393b46b91afcf5b63f955c7dae5aae Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Mon, 22 Oct 2018 10:03:28 +0200 Subject: [PATCH] elm_toolbar: fix prio.visible prio.visible is ignored in case of SHRINK_EXPAND is used. every single item is just stuffed into a box. Thus in case that the *more flag indicates that another box is displayed (rather than not fitting items), then we do not set the visibility flag on the item - as the item is used anyways. ref T6806. Differential Revision: https://phab.enlightenment.org/D7185 --- src/lib/elementary/elm_toolbar.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c index a543f7dbc1..95a896221d 100644 --- a/src/lib/elementary/elm_toolbar.c +++ b/src/lib/elementary/elm_toolbar.c @@ -87,6 +87,7 @@ _items_visibility_fix(Elm_Toolbar *obj, Elm_Toolbar_Data *sd, Evas_Coord *iw, Evas_Coord vw, + Eina_Bool usage_bx_more, Eina_Bool *more) { Elm_Toolbar_Item_Data *it, *prev; @@ -125,11 +126,22 @@ _items_visibility_fix(Elm_Toolbar *obj, evas_object_geometry_get(VIEW(it), NULL, NULL, &ciw, &cih); if (!efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE)) *iw += cih; else *iw += ciw; - it->prio.visible = (*iw <= vw); + //expand is the case where the bx_more stuff is used and the prio.visible is completly ignored. + //if this is the case - then every item in there is just visible in the box - nothing (beside the items in the other box is hidden) + if (!usage_bx_more) + { + it->prio.visible = (*iw <= vw); + if (!it->prio.visible) + *more = EINA_TRUE; + } + else + { + it->prio.visible = EINA_TRUE; + } + it->in_box = sd->bx; if (!it->separator) count++; - if (!it->prio.visible) - *more = EINA_TRUE; + } else { @@ -386,12 +398,12 @@ _resize_job(void *data) if (!efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE)) { h = vh; - _items_visibility_fix(obj, sd, &ih, vh, &more); + _items_visibility_fix(obj, sd, &ih, vh, EINA_FALSE, &more); } else { w = vw; - _items_visibility_fix(obj, sd, &iw, vw, &more); + _items_visibility_fix(obj, sd, &iw, vw, EINA_FALSE, &more); } evas_object_geometry_get (sd->VIEW(more_item), NULL, NULL, &more_w, &more_h); @@ -467,12 +479,12 @@ _resize_job(void *data) if (!efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE)) { h = vh; - _items_visibility_fix(obj, sd, &ih, vh, &more); + _items_visibility_fix(obj, sd, &ih, vh, EINA_FALSE, &more); } else { w = vw; - _items_visibility_fix(obj, sd, &iw, vw, &more); + _items_visibility_fix(obj, sd, &iw, vw, EINA_FALSE, &more); } evas_object_box_remove_all(sd->bx, EINA_FALSE); if ((!efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE) && (ih > vh)) || @@ -510,9 +522,9 @@ _resize_job(void *data) w = (vw >= mw) ? vw : mw; if (!efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE)) - _items_visibility_fix(obj, sd, &ih, vh, &more); + _items_visibility_fix(obj, sd, &ih, vh, EINA_TRUE, &more); else - _items_visibility_fix(obj, sd, &iw, vw, &more); + _items_visibility_fix(obj, sd, &iw, vw, EINA_TRUE, &more); evas_object_box_remove_all(sd->bx, EINA_FALSE); evas_object_box_remove_all(sd->bx_more, EINA_FALSE);