elm_spinner: sync button visibility 39/257539/8
authorShinwoo Kim <cinoo.kim@samsung.com>
Tue, 27 Apr 2021 09:36:51 +0000 (18:36 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Tue, 25 May 2021 01:11:19 +0000 (01:11 +0000)
This patch is related to accessibility.
The button of spinner has visible state, even though spinner does not show.

The efl_ui_clock could use spiner internally.
Usually it adds 5 spinners and does not show some of them according to
the time format.

We tried to apply following patch, but it is not acceptable.
- elm_datetime_format_set(dd->datetime, "%d/%b/%Y %I:%M %p");
+ elm_datetime_format_set(dd->datetime, "%I:%M %p");

- elm_datetime_format_set(dd->datetime, "%d/%b/%Y %H:%M");
+ elm_datetime_format_set(dd->datetime, "%H:%M");

Change-Id: If7182e669271931b54b3266f79252c87f4cd6bdf

src/lib/elementary/elm_spinner.c
src/lib/elementary/elm_spinner_eo.c

index 23e8e12..82dbe4f 100644 (file)
@@ -2748,6 +2748,25 @@ _elm_spinner_class_constructor(Efl_Class *klass)
       _elm_spinner_smart_focus_next_enable = EINA_TRUE;
 }
 
+EOLIAN static void
+_elm_spinner_efl_gfx_entity_visible_set(Eo *obj, Elm_Spinner_Data *sd, Eina_Bool vis)
+{
+   efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis);
+
+   if (vis)
+     {
+        evas_object_show(sd->inc_button);
+        evas_object_show(sd->dec_button);
+        evas_object_show(sd->text_button);
+     }
+   else
+     {
+        evas_object_hide(sd->inc_button);
+        evas_object_hide(sd->dec_button);
+        evas_object_hide(sd->text_button);
+     }
+}
+
 EOLIAN static const Efl_Access_Action_Data *
 _elm_spinner_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd EINA_UNUSED)
 {
index 2f177bd..f68a652 100644 (file)
@@ -298,6 +298,7 @@ _elm_spinner_class_initializer(Efl_Class *klass)
       EFL_OBJECT_OP_FUNC(elm_obj_spinner_interval_get, _elm_spinner_interval_get),
       EFL_OBJECT_OP_FUNC(elm_obj_spinner_round_set, _elm_spinner_round_set),
       EFL_OBJECT_OP_FUNC(elm_obj_spinner_round_get, _elm_spinner_round_get),
+      EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_spinner_efl_gfx_entity_visible_set),
       EFL_OBJECT_OP_FUNC(elm_obj_spinner_editable_set, _elm_spinner_editable_set),
       EFL_OBJECT_OP_FUNC(elm_obj_spinner_editable_get, _elm_spinner_editable_get),
       EFL_OBJECT_OP_FUNC(elm_obj_spinner_base_set, _elm_spinner_base_set),