summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinkyu Kang <mk7.kang@samsung.com>2016-01-20 17:06:22 +0900
committerHermet Park <hermet@hermet.pe.kr>2016-01-20 17:06:22 +0900
commit2eb95a547736af1445b0a292223ad8973ad24acb (patch)
tree4de437f3dbd840eca0f83ebd7d3bdcc5e219a586
parent31027d719fc21122c042aab90dad7ae6d817b40c (diff)
elm_widget: cleanup _elm_widget_on_focus function
Summary: This patch will reduce duplicate codes and code depth for readability Signed-off-by: Minkyu Kang <mk7.kang@samsung.com> Reviewers: seoz, Hermet, cedric Subscribers: seoz Differential Revision: https://phab.enlightenment.org/D3574
-rw-r--r--src/lib/elm_widget.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 97ef04543..11d4ee091 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -5743,30 +5743,22 @@ _elm_widget_eo_base_destructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
5743EOLIAN static Eina_Bool 5743EOLIAN static Eina_Bool
5744_elm_widget_on_focus(Eo *obj, Elm_Widget_Smart_Data *sd, Elm_Object_Item *item EINA_UNUSED) 5744_elm_widget_on_focus(Eo *obj, Elm_Widget_Smart_Data *sd, Elm_Object_Item *item EINA_UNUSED)
5745{ 5745{
5746 if (elm_widget_can_focus_get(obj)) 5746 Eina_Bool focused;
5747 { 5747 const Eo_Event_Description *desc;
5748 if (elm_widget_focus_get(obj)) 5748
5749 { 5749 if (!elm_widget_can_focus_get(obj))
5750 if (!sd->resize_obj)
5751 evas_object_focus_set(obj, EINA_TRUE);
5752 eo_do(obj, eo_event_callback_call
5753 (ELM_WIDGET_EVENT_FOCUSED, NULL));
5754 if (_elm_config->atspi_mode && !elm_widget_child_can_focus_get(obj))
5755 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_FOCUSED, EINA_TRUE);
5756 }
5757 else
5758 {
5759 if (!sd->resize_obj)
5760 evas_object_focus_set(obj, EINA_FALSE);
5761 eo_do(obj, eo_event_callback_call
5762 (ELM_WIDGET_EVENT_UNFOCUSED, NULL));
5763 if (_elm_config->atspi_mode && !elm_widget_child_can_focus_get(obj))
5764 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_FOCUSED, EINA_FALSE);
5765 }
5766 }
5767 else
5768 return EINA_FALSE; 5750 return EINA_FALSE;
5769 5751
5752 focused = elm_widget_focus_get(obj);
5753 desc = focused ? ELM_WIDGET_EVENT_FOCUSED : ELM_WIDGET_EVENT_UNFOCUSED;
5754
5755 if (!sd->resize_obj)
5756 evas_object_focus_set(obj, focused);
5757 eo_do(obj, eo_event_callback_call(desc, NULL));
5758
5759 if (_elm_config->atspi_mode && !elm_widget_child_can_focus_get(obj))
5760 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_FOCUSED, focused);
5761
5770 return EINA_TRUE; 5762 return EINA_TRUE;
5771} 5763}
5772 5764