summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangHyeon Lee <sh10233.lee@samsung.com>2015-03-11 19:59:58 +0900
committerJaehwan Kim <jae.hwan.kim@samsung.com>2015-03-11 20:35:53 +0900
commit260cdd6150d567fcee8d1afaf690e4b90cd16a2b (patch)
tree470e39d7b6f5338d1978ad588f577fc1f4ab6987
parentdcca75666c54cae8b80210f7bdc3c17aff0d273f (diff)
Genlist/Gengrid : Modified to handle the focus highlight on unrealized items
Summary: When unrealized item is focused, edje object is not exist, so genlist cannot read the focus highlight information from edje object. Therefore, when the item is realized, check the item is focused or not and need to update focus highlight. @fix Test Plan: change edc for supporting focus highlight in edc, and set focus on unrealized items. Reviewers: raster, seoz, jaehwan Differential Revision: https://phab.enlightenment.org/D2128
-rw-r--r--src/lib/elm_gengrid.c45
-rw-r--r--src/lib/elm_genlist.c38
2 files changed, 65 insertions, 18 deletions
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index 0f4165435..35cb0072e 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -1014,6 +1014,13 @@ _item_realize(Elm_Gen_Item *it)
1014 if (it->mouse_cursor) 1014 if (it->mouse_cursor)
1015 eo_do(eo_it, elm_wdg_item_cursor_set(it->mouse_cursor)); 1015 eo_do(eo_it, elm_wdg_item_cursor_set(it->mouse_cursor));
1016 1016
1017 if (eo_it == sd->focused_item)
1018 {
1019 _elm_widget_item_highlight_in_theme(WIDGET(it), EO_OBJ(it));
1020 _elm_widget_highlight_in_theme_update(WIDGET(it));
1021 _elm_widget_focus_highlight_start(WIDGET(it));
1022 }
1023
1017 it->realized = EINA_TRUE; 1024 it->realized = EINA_TRUE;
1018 it->want_unrealize = EINA_FALSE; 1025 it->want_unrealize = EINA_FALSE;
1019} 1026}
@@ -1617,15 +1624,18 @@ _elm_gengrid_item_focused(Elm_Object_Item *eo_it)
1617 1624
1618 sd->focused_item = eo_it; 1625 sd->focused_item = eo_it;
1619 1626
1620 if (elm_widget_focus_highlight_enabled_get(obj)) 1627 if (it->realized)
1621 { 1628 {
1622 edje_object_signal_emit 1629 if (elm_widget_focus_highlight_enabled_get(obj))
1623 (VIEW(it), "elm,state,focused", "elm"); 1630 {
1624 } 1631 edje_object_signal_emit
1632 (VIEW(it), "elm,state,focused", "elm");
1633 }
1625 1634
1626 focus_raise = edje_object_data_get(VIEW(it), "focusraise"); 1635 focus_raise = edje_object_data_get(VIEW(it), "focusraise");
1627 if ((focus_raise) && (!strcmp(focus_raise, "on"))) 1636 if ((focus_raise) && (!strcmp(focus_raise, "on")))
1628 evas_object_raise(VIEW(it)); 1637 evas_object_raise(VIEW(it));
1638 }
1629 evas_object_smart_callback_call(obj, SIG_ITEM_FOCUSED, eo_it); 1639 evas_object_smart_callback_call(obj, SIG_ITEM_FOCUSED, eo_it);
1630} 1640}
1631 1641
@@ -3460,9 +3470,24 @@ _elm_gengrid_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bo
3460 _elm_gengrid_item_unfocused(sd->focused_item); 3470 _elm_gengrid_item_unfocused(sd->focused_item);
3461 _elm_gengrid_item_focused(eo_it); 3471 _elm_gengrid_item_focused(eo_it);
3462 3472
3463 _elm_widget_item_highlight_in_theme(obj, eo_it); 3473 /* If item is not realized state, widget couldn't get focus_highlight data. */
3464 _elm_widget_highlight_in_theme_update(obj); 3474 if (it->realized)
3465 _elm_widget_focus_highlight_start(obj); 3475 {
3476 const char *focus_raise;
3477 if (elm_widget_focus_highlight_enabled_get(obj))
3478 {
3479 edje_object_signal_emit
3480 (VIEW(it), "elm,state,focused", "elm");
3481 }
3482
3483 focus_raise = edje_object_data_get(VIEW(it), "focusraise");
3484 if ((focus_raise) && (!strcmp(focus_raise, "on")))
3485 evas_object_raise(VIEW(it));
3486
3487 _elm_widget_item_highlight_in_theme(obj, eo_it);
3488 _elm_widget_highlight_in_theme_update(obj);
3489 _elm_widget_focus_highlight_start(obj);
3490 }
3466 } 3491 }
3467 } 3492 }
3468 else 3493 else
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 9258cda07..87b3c2d4b 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -1731,6 +1731,21 @@ _item_realize(Elm_Gen_Item *it,
1731 1731
1732 _elm_genlist_item_state_update(it, itc); 1732 _elm_genlist_item_state_update(it, itc);
1733 _elm_genlist_item_index_update(it); 1733 _elm_genlist_item_index_update(it);
1734
1735 if (EO_OBJ(it) == sd->focused_item)
1736 {
1737 const char *focus_raise;
1738 if (elm_widget_focus_highlight_enabled_get(WIDGET(it)))
1739 edje_object_signal_emit(VIEW(it), SIGNAL_FOCUSED, "elm");
1740
1741 focus_raise = edje_object_data_get(VIEW(it), "focusraise");
1742 if ((focus_raise) && (!strcmp(focus_raise, "on")))
1743 evas_object_raise(VIEW(it));
1744
1745 _elm_widget_item_highlight_in_theme(WIDGET(it), EO_OBJ(it));
1746 _elm_widget_highlight_in_theme_update(WIDGET(it));
1747 _elm_widget_focus_highlight_start(WIDGET(it));
1748 }
1734 } 1749 }
1735 1750
1736 /* homogeneous genlist shortcut */ 1751 /* homogeneous genlist shortcut */
@@ -2569,12 +2584,15 @@ _elm_genlist_item_focused(Elm_Object_Item *eo_it)
2569 2584
2570 sd->focused_item = eo_it; 2585 sd->focused_item = eo_it;
2571 2586
2572 if (elm_widget_focus_highlight_enabled_get(obj)) 2587 if (it->realized)
2573 edje_object_signal_emit(VIEW(it), SIGNAL_FOCUSED, "elm"); 2588 {
2589 if (elm_widget_focus_highlight_enabled_get(obj))
2590 edje_object_signal_emit(VIEW(it), SIGNAL_FOCUSED, "elm");
2574 2591
2575 focus_raise = edje_object_data_get(VIEW(it), "focusraise"); 2592 focus_raise = edje_object_data_get(VIEW(it), "focusraise");
2576 if ((focus_raise) && (!strcmp(focus_raise, "on"))) 2593 if ((focus_raise) && (!strcmp(focus_raise, "on")))
2577 evas_object_raise(VIEW(it)); 2594 evas_object_raise(VIEW(it));
2595 }
2578 evas_object_smart_callback_call(obj, SIG_ITEM_FOCUSED, eo_it); 2596 evas_object_smart_callback_call(obj, SIG_ITEM_FOCUSED, eo_it);
2579} 2597}
2580 2598
@@ -5806,9 +5824,13 @@ _elm_genlist_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bo
5806 _elm_genlist_item_unfocused(sd->focused_item); 5824 _elm_genlist_item_unfocused(sd->focused_item);
5807 _elm_genlist_item_focused(eo_it); 5825 _elm_genlist_item_focused(eo_it);
5808 5826
5809 _elm_widget_item_highlight_in_theme(obj, EO_OBJ(it)); 5827 /* If item is not realized state, widget couldn't get focus_highlight data. */
5810 _elm_widget_highlight_in_theme_update(obj); 5828 if (it->realized)
5811 _elm_widget_focus_highlight_start(obj); 5829 {
5830 _elm_widget_item_highlight_in_theme(obj, EO_OBJ(it));
5831 _elm_widget_highlight_in_theme_update(obj);
5832 _elm_widget_focus_highlight_start(obj);
5833 }
5812 } 5834 }
5813 } 5835 }
5814 else 5836 else