layout: Remove sub_object_add_enable

Same as the previous patch. This was an ugly hack. Use another
one instead.

Ref T5315
This commit is contained in:
Jean-Philippe Andre 2017-08-02 21:39:25 +09:00
parent a4940ae6c9
commit aebd37cab8
6 changed files with 11 additions and 41 deletions

View File

@ -615,9 +615,12 @@ _base_shift_by_arrow(Evas_Object *arrow,
}
EOLIAN static Eina_Bool
_elm_ctxpopup_elm_layout_sub_object_add_enable(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *_pd EINA_UNUSED)
_elm_ctxpopup_elm_widget_sub_object_add(Eo *obj, Elm_Ctxpopup_Data *_pd EINA_UNUSED, Evas_Object *sobj)
{
return EINA_FALSE;
/* Skipping elm_layout sub_object_add in order to ignore size hint changes.
* Note: It is not clear WHY we are doing this. Same reason as genlist?
*/
return elm_obj_widget_sub_object_add(efl_cast(obj, ELM_WIDGET_CLASS), sobj);
}
EOLIAN static void

View File

@ -160,6 +160,7 @@ class Elm.Ctxpopup (Elm.Layout, Elm.Interface.Atspi_Widget_Action,
Elm.Widget.focus_next_manager_is;
Elm.Widget.focus_next;
Elm.Widget.disable;
Elm.Widget.sub_object_add;
Elm.Widget.translate;
Elm.Widget.theme_apply;
Elm.Widget.widget_event;
@ -167,7 +168,6 @@ class Elm.Ctxpopup (Elm.Layout, Elm.Interface.Atspi_Widget_Action,
Efl.Ui.Menu.first_item { get; }
Efl.Ui.Menu.last_item { get; }
Efl.Ui.Menu.items { get; }
Elm.Layout.sub_object_add_enable;
Elm.Layout.sizing_eval;
Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
Elm.Interface.Atspi_Accessible.state_set { get; }

View File

@ -3210,27 +3210,16 @@ _elm_genlist_elm_widget_widget_event(Eo *obj, Elm_Genlist_Data *sd, Evas_Object
return EINA_TRUE;
}
/* This function disables the specific code of the layout sub object add.
* Only the widget sub_object_add is called.
*/
EOLIAN static Eina_Bool
_elm_genlist_elm_layout_sub_object_add_enable(Eo *obj EINA_UNUSED, Elm_Genlist_Data *_pd EINA_UNUSED)
{
return EINA_FALSE;
}
EOLIAN static Eina_Bool
_elm_genlist_elm_widget_sub_object_add(Eo *obj, Elm_Genlist_Data *_pd EINA_UNUSED, Evas_Object *sobj)
{
// FIXME: THIS COMMENT IS INVALID! WE ARE NOT SKIPPING ELM_LAYOUT!
/* skipping layout's code, which registers size hint changing
* callback on sub objects. this is here because items'
* content_get() routines may change hints on the objects after
* creation, thus issuing TOO MANY sizing_eval()'s here. they are
* not needed at here anyway, so let's skip listening to those
* hints changes */
return elm_obj_widget_sub_object_add(efl_super(obj, MY_CLASS), sobj);
return elm_obj_widget_sub_object_add(efl_cast(obj, ELM_WIDGET_CLASS), sobj);
}
EOLIAN static Eina_Bool
@ -3238,20 +3227,14 @@ _elm_genlist_elm_widget_sub_object_del(Eo *obj, Elm_Genlist_Data *sd, Evas_Objec
{
Eina_Bool int_ret = EINA_FALSE;
// FIXME: THIS COMMENT IS INVALID! WE ARE NOT SKIPPING ELM_LAYOUT!
/* XXX: hack -- also skipping sizing recalculation on
* sub-object-del. genlist's crazy code paths (like groups and
* such) seem to issue a whole lot of deletions and Evas bitches
* about too many recalculations */
sd->on_sub_del = EINA_TRUE;
int_ret = elm_obj_widget_sub_object_del(efl_super(obj, MY_CLASS), sobj);
if (!int_ret) return EINA_FALSE;
sd->on_sub_del = EINA_FALSE;
return EINA_TRUE;
return int_ret;
}
/*

View File

@ -544,7 +544,6 @@ class Elm.Genlist (Elm.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
Elm.Widget.widget_event;
Elm.Widget.focused_item { get; }
Elm.Widget.item_loop_enabled { get; set; }
Elm.Layout.sub_object_add_enable;
Elm.Layout.sizing_eval;
Elm.Interface_Scrollable.bounce_allow { get; set; }
Elm.Interface_Scrollable.policy { get; set; }

View File

@ -499,13 +499,9 @@ _elm_layout_elm_widget_sub_object_add(Eo *obj, Elm_Layout_Smart_Data *_pd EINA_U
int_ret = elm_obj_widget_sub_object_add(efl_super(obj, MY_CLASS), sobj);
if (!int_ret) return EINA_FALSE;
Eina_Bool enable = EINA_TRUE;
enable = elm_obj_layout_sub_object_add_enable(obj);
if (EINA_TRUE == enable)
evas_object_event_callback_add
(sobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_on_sub_object_size_hint_change, obj);
evas_object_event_callback_add
(sobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_on_sub_object_size_hint_change, obj);
return EINA_TRUE;
}
@ -590,12 +586,6 @@ _edje_signal_callback(void *data,
esd->func(esd->data, esd->obj, emission, source);
}
EOLIAN static Eina_Bool
_elm_layout_sub_object_add_enable(Eo *obj EINA_UNUSED, Elm_Layout_Smart_Data *_pd EINA_UNUSED)
{
return EINA_TRUE;
}
EAPI Eina_Bool
_elm_layout_part_aliasing_eval(const Evas_Object *obj,
const char **part,

View File

@ -114,11 +114,6 @@ class Elm.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File,
callback function.]]
}
}
sub_object_add_enable {
[[Enable sub object add]]
legacy: null;
return: bool; [[$true on success, $false otherwise]]
}
data_get @const {
[[Get the edje data from the given layout.