elm_entry: fix wrong displayed scrollbars
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Thu, 7 Nov 2019 20:45:02 +0000 (21:45 +0100)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 11 Nov 2019 02:20:43 +0000 (11:20 +0900)
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

src/lib/elementary/elm_entry.c
src/lib/elementary/elm_interface_scrollable.c
src/lib/elementary/elm_interface_scrollable.eo

index 2cbeb85..1b0de2e 100644 (file)
@@ -1398,6 +1398,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");
index be7e22d..868057d 100644 (file)
@@ -4576,6 +4576,21 @@ _scroll_event_object_detach(Evas_Object *obj)
 }
 
 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)
 {
    Evas_Coord mw, mh;
@@ -4587,10 +4602,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);
index 247ea95..b128fa7 100644 (file)
@@ -683,6 +683,9 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Focus
       }
       //
 
+      reset_signals {
+        [[Call this if you have changed the group of the object passed to @.objects]]
+      }
    }
    implements {
       class.constructor;