elm_entry: fix wrong displayed scrollbars

the scrolbars have been displayed wrongly before. Reason for this is
that the theme displays the bars per default, the code however works
with hidden by default. This was worked arround before with the fact
that we are explicitly hiding the vbar/hbar before.
The reason this previous code was not working proberly is that entry
decided to retheme a object that was already set to the interface
scrollable object. Which means, it was not detected by the code. With
the newly introduced reset function you can tell the interface, that you
have changed the group, signals will be emitted accordingly.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10622
This commit is contained in:
Marcel Hollerbach 2019-11-07 21:45:02 +01:00
parent 1f66d9ed9b
commit 01bf9a34d6
3 changed files with 20 additions and 4 deletions

View File

@ -1003,6 +1003,7 @@ _elm_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd)
elm_widget_theme_object_set
(obj, sd->scr_edje, "scroller", "entry", style);
elm_interface_scrollable_reset_signals(obj);
_elm_entry_background_switch(sd->entry_edje, sd->scr_edje);
str = edje_object_data_get(sd->scr_edje, "focus_highlight");

View File

@ -4027,6 +4027,21 @@ _scroll_event_object_detach(Evas_Object *obj)
_elm_scroll_mouse_move_event_cb, sid);
}
EOLIAN static void
_elm_interface_scrollable_reset_signals(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid)
{
sid->go_up = sid->go_down = sid->go_right = sid->go_left = EINA_FALSE;
edje_object_signal_emit(sid->edje_obj, "elm,action,hide,up", "elm");
edje_object_signal_emit(sid->edje_obj, "elm,action,hide,down", "elm");
edje_object_signal_emit(sid->edje_obj, "elm,action,hide,right", "elm");
edje_object_signal_emit(sid->edje_obj, "elm,action,hide,left", "elm");
edje_object_signal_emit(sid->edje_obj, "elm,action,hide,vbar", "elm");
edje_object_signal_emit(sid->edje_obj, "elm,action,hide,hbar", "elm");
_elm_scroll_scroll_bar_visibility_adjust(sid);
}
EOLIAN static void
_elm_interface_scrollable_objects_set(Eo *obj, Elm_Scrollable_Smart_Interface_Data *sid, Evas_Object *edje_object, Evas_Object *hit_rectangle)
{
@ -4039,10 +4054,7 @@ _elm_interface_scrollable_objects_set(Eo *obj, Elm_Scrollable_Smart_Interface_Da
sid->edje_obj = edje_object;
edje_object_signal_emit(sid->edje_obj, "elm,action,hide,up", "elm");
edje_object_signal_emit(sid->edje_obj, "elm,action,hide,down", "elm");
edje_object_signal_emit(sid->edje_obj, "elm,action,hide,right", "elm");
edje_object_signal_emit(sid->edje_obj, "elm,action,hide,left", "elm");
elm_interface_scrollable_reset_signals(obj);
if (sid->event_rect)
_scroll_event_object_detach(obj);

View File

@ -647,6 +647,9 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Focus
enable: bool; [[True to enable looping.]]
}
}
reset_signals {
[[Call this if you have changed the group of the object passed to @.objects]]
}
}
implements {
class.constructor;