genlist : apply focus bg hide when list is scrolled 92/168692/4
authorSangHyeon Lee <sh10233.lee@samsung.com>
Tue, 30 Jan 2018 07:11:18 +0000 (16:11 +0900)
committerSangHyeon Lee <sh10233.lee@samsung.com>
Tue, 30 Jan 2018 07:25:43 +0000 (16:25 +0900)
Change-Id: I6ae00177d35d389d005dba0ee7669e37bebc28c2
Signed-off-by: SangHyeon Lee <sh10233.lee@samsung.com>
src/mobile_lib/elm_genlist.c

index 51d7136..7234745 100644 (file)
@@ -164,7 +164,7 @@ static const char SIGNAL_BG_CHANGE[] = "bg_color_change";
 static const char SIGNAL_ITEM_HIGHLIGHTED[] = "elm,state,highlighted";
 static const char SIGNAL_ITEM_UNHIGHLIGHTED[] = "elm,state,unhighlighted";
 static const char SIGNAL_FOCUS_BG_SHOW[] = "elm,state,focus_bg,show";
-//static const char SIGNAL_FOCUS_BG_HIDE[] = "elm,state,focus_bg,hide";
+static const char SIGNAL_FOCUS_BG_HIDE[] = "elm,state,focus_bg,hide";
 
 typedef enum
 {
@@ -1537,7 +1537,11 @@ _focus_bg_show(Elm_Gen_Item *it)
 
    if (!VIEW(it)) return;
    focus_bg = edje_object_data_get(VIEW(it), "focus_bg");
-   if (focus_bg && !strcmp(focus_bg, "off")) return;
+   if (focus_bg && !strcmp(focus_bg, "off"))
+     {
+        edje_object_signal_emit(wd->resize_obj, SIGNAL_FOCUS_BG_HIDE, "elm");
+        return;
+     }
 
    evas_object_geometry_get(wd->resize_obj, NULL, NULL, &w, NULL);
    top = edje_object_part_object_get(VIEW(it), "elm.padding.focus_bg.top");
@@ -2413,6 +2417,7 @@ _elm_genlist_pan_evas_object_smart_calculate(Eo *obj, Elm_Genlist_Pan_Data *psd)
 {
    Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh;
    Item_Block *itb;
+   ELM_WIDGET_DATA_GET_OR_RETURN(psd->wsd->obj, wd);
 
    evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
    evas_output_viewport_get(evas_object_evas_get(obj), &cvx, &cvy, &cvw, &cvh);
@@ -2708,6 +2713,7 @@ _elm_genlist_pan_evas_object_smart_calculate(Eo *obj, Elm_Genlist_Pan_Data *psd)
           {
              if (psd->wsd->aligned_item && (psd->wsd->aligned_item != psd->wsd->adjusted_item))
                edje_object_signal_emit(VIEW(psd->wsd->aligned_item), SIGNAL_ITEM_UNHIGHLIGHTED, "elm");
+               edje_object_signal_emit(wd->resize_obj, SIGNAL_FOCUS_BG_HIDE, "elm");
              psd->wsd->aligned_item = NULL;
              psd->wsd->unhighlight_skip = EINA_TRUE;
              eo_do(WIDGET(it), elm_interface_scrollable_content_region_show(x, y, ow, oh));
@@ -4199,6 +4205,8 @@ _elm_genlist_elm_widget_theme_apply(Eo *obj, Elm_Genlist_Data *sd)
    elm_layout_sizing_eval(obj);
    _changed(sd->pan_obj);
 
+   edje_object_signal_emit(wsd->resize_obj, SIGNAL_FOCUS_BG_HIDE, "elm");
+
    if (wsd->scroll_item_align_enable && sd->aligned_item)
      elm_genlist_item_show(EO_OBJ(sd->aligned_item), ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
 
@@ -5634,6 +5642,10 @@ _scroll_animate_start_cb(Evas_Object *obj,
 {
    ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
    evas_object_smart_callback_call(obj, SIG_SCROLL_ANIM_START, NULL);
+   if (wd->scroll_item_align_enable)
+     {
+        edje_object_signal_emit(wd->resize_obj, SIGNAL_FOCUS_BG_HIDE, "elm");
+     }
 }
 
 static void
@@ -5657,6 +5669,10 @@ _scroll_drag_start_cb(Evas_Object *obj,
 {
    ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
    evas_object_smart_callback_call(obj, SIG_SCROLL_DRAG_START, NULL);
+   if (wd->scroll_item_align_enable)
+     {
+        edje_object_signal_emit(wd->resize_obj, SIGNAL_FOCUS_BG_HIDE, "elm");
+     }
 }
 
 static Eina_Bool