[popup][access] unregister outline access object if there is a button on the popup
authorShinwoo Kim <cinoo.kim@samsung.com>
Tue, 7 May 2013 13:25:46 +0000 (22:25 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Mon, 27 May 2013 05:15:18 +0000 (14:15 +0900)
Change-Id: I71fa5908d421a021ea92245e3e59df68382eede4

src/lib/elc_popup.c

index bff0d28..602f4cf 100644 (file)
@@ -264,12 +264,15 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
           }
 
         /* register outline */
-        ao = _elm_access_edje_object_part_object_register
-               (obj, ELM_WIDGET_DATA(sd)->resize_obj, ACCESS_BASE_PART);
-        _elm_access_text_set(_elm_access_object_get(ao),
-                             ELM_ACCESS_TYPE, E_(OUTLINE_TEXT));
-        _elm_access_activate_callback_set
-          (_elm_access_object_get(ao), _access_base_activate_cb, obj);
+        if (!sd->button_count)
+          {
+             ao = _elm_access_edje_object_part_object_register
+                    (obj, ELM_WIDGET_DATA(sd)->resize_obj, ACCESS_BASE_PART);
+             _elm_access_text_set(_elm_access_object_get(ao),
+                                  ELM_ACCESS_TYPE, E_(OUTLINE_TEXT));
+             _elm_access_activate_callback_set
+               (_elm_access_object_get(ao), _access_base_activate_cb, obj);
+          }
      }
    else
      {
@@ -286,8 +289,9 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
           }
 
         /* unregister outline */
-        _elm_access_edje_object_part_object_unregister
-               (obj, ELM_WIDGET_DATA(sd)->resize_obj, ACCESS_BASE_PART);
+        if (!sd->button_count)
+          _elm_access_edje_object_part_object_unregister
+                 (obj, ELM_WIDGET_DATA(sd)->resize_obj, ACCESS_BASE_PART);
      }
 }
 
@@ -1152,6 +1156,7 @@ _action_button_set(Evas_Object *obj,
    int i = 0;
    Action_Area_Data *adata;
    char buf[128];
+   Evas_Object *ao;
 
    ELM_POPUP_DATA_GET(obj, sd);
 
@@ -1171,6 +1176,17 @@ _action_button_set(Evas_Object *obj,
         sd->no_shift = EINA_FALSE;
      }
 
+   if (_elm_config->access_mode)
+     {
+        /* if popup has a button, popup should be closed by the button
+           so outline(ACCESS_BASE_PART) is not necessary any more */
+        ao = _access_object_get(obj, ACCESS_BASE_PART);
+
+        if (ao && sd->button_count)
+          _elm_access_edje_object_part_object_unregister
+               (obj, ELM_WIDGET_DATA(sd)->resize_obj, ACCESS_BASE_PART);
+     }
+
    snprintf(buf, sizeof(buf), "buttons%u", sd->button_count);
    elm_layout_theme_set
      (sd->action_area, "popup", buf, elm_widget_style_get(obj));