elc_naviframe: Fix to show prev item when top item is deleted 01/192001/3
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Fri, 26 Oct 2018 12:06:34 +0000 (21:06 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Fri, 26 Oct 2018 12:13:28 +0000 (21:13 +0900)
When top item is deleted, previous item should be shown.

Change-Id: Ide750d7722b3d246fcdd08fc5b7823e1fc58e035

src/lib/elementary/elc_naviframe.c

index 0bf3f51..9c150c4 100644 (file)
@@ -1333,6 +1333,7 @@ _elm_naviframe_item_efl_object_invalidate(Eo *eo_item, Elm_Naviframe_Item_Data *
    Elm_Naviframe_Item_Data *prev_it = NULL;
    Elm_Naviframe_Content_Item_Pair *content_pair;
    Eina_Inlist *l;
+   Eina_Bool top;
 
    ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
    if (it->title_prev_btn)
@@ -1368,9 +1369,10 @@ _elm_naviframe_item_efl_object_invalidate(Eo *eo_item, Elm_Naviframe_Item_Data *
    if (evas_object_data_get(VIEW(it), "out_of_list"))
      goto end;
 
+   top = (eo_item == elm_naviframe_top_item_get(WIDGET(it)));
    sd->stack = eina_inlist_remove(sd->stack, EINA_INLIST_GET(it));
 
-   if ((elm_naviframe_top_item_get(WIDGET(it)) == eo_item) && !sd->on_deletion) /* must raise another one */
+   if (top && !sd->on_deletion) /* must raise another one */
      {
         if (sd->stack && sd->stack->last)
           prev_it = EINA_INLIST_CONTAINER_GET(sd->stack->last,