toolbar: delay evaluation of the toolbar size until it stabilize.
Elementary is not using much the calculate callback from Evas. This create all sort of problem where it transform O(n) algorithm. Like sizing a toolbar for next frame to O(n^n) by actually sizing the toolbar every time an object is inserted. T2777
This commit is contained in:
parent
e13d263fe1
commit
58d38c10d2
|
@ -1304,7 +1304,7 @@ _item_theme_hook(Evas_Object *obj,
|
|||
(VIEW(it), EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
}
|
||||
_resizing_eval_item(it);
|
||||
_sizing_eval(obj);
|
||||
evas_object_smart_need_recalculate_set(obj, EINA_TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1475,7 +1475,7 @@ _elm_toolbar_elm_widget_theme_apply(Eo *obj, Elm_Toolbar_Data *sd)
|
|||
_item_theme_hook(obj, sd->more_item, scale, sd->icon_size);
|
||||
|
||||
_elm_toolbar_highlight_in_theme(obj);
|
||||
_sizing_eval(obj);
|
||||
evas_object_smart_need_recalculate_set(obj, EINA_TRUE);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
@ -1659,9 +1659,8 @@ _item_resize(void *data,
|
|||
Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
_sizing_eval(data);
|
||||
evas_object_smart_need_recalculate_set(data, EINA_TRUE);
|
||||
_resizing_eval(data);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -3360,7 +3359,7 @@ _elm_toolbar_shrink_mode_set(Eo *obj, Elm_Toolbar_Data *sd, Elm_Toolbar_Shrink_M
|
|||
eo_do(obj, elm_interface_scrollable_policy_set
|
||||
(ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF));
|
||||
|
||||
_sizing_eval(obj);
|
||||
evas_object_smart_need_recalculate_set(obj, EINA_TRUE);
|
||||
}
|
||||
|
||||
EOLIAN static Elm_Toolbar_Shrink_Mode
|
||||
|
@ -3958,5 +3957,12 @@ _elm_toolbar_elm_interface_atspi_selection_child_deselect(Eo *obj EINA_UNUSED, E
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EOLIAN void
|
||||
_elm_toolbar_evas_object_smart_calculate(Eo *obj, Elm_Toolbar_Data *pd)
|
||||
{
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
|
||||
#include "elm_toolbar.eo.c"
|
||||
#include "elm_toolbar_item.eo.c"
|
||||
|
|
|
@ -359,6 +359,7 @@ class Elm.Toolbar (Elm.Widget, Elm_Interface_Scrollable,
|
|||
implements {
|
||||
class.constructor;
|
||||
Eo.Base.constructor;
|
||||
Evas.Object_Smart.calculate;
|
||||
Evas.Object_Smart.move;
|
||||
Evas.Object_Smart.add;
|
||||
Evas.Object_Smart.del;
|
||||
|
|
Loading…
Reference in New Issue