From c4cad315ae6a8ca8dedd90ce3ba37d9fd8bcf815 Mon Sep 17 00:00:00 2001 From: Guilherme Iscaro de Godoy Date: Wed, 12 Mar 2014 10:02:17 -0300 Subject: [PATCH] Bug fix: Elm_List was not correctly setting the highlight theme for its items. With the introduction of the patch 3628a8c4ea2485ee7ee5a81cfd4e0f0fe62b10d6, it is possible to highlight focused Elm_List and Elm_Genlistenlist items. However, this feature does not work correctly if one wants to create a custom highlight theme for Elm_List items. The whole problem was happening, because the function _elm_widget_item_highlight_in_theme() was being called in a incorrect location. This function must be called at _items_fix(), because there the Elm_List already set the item theme and then it's possible to check if the one wants a custom highlight or not. --- legacy/elementary/src/lib/elm_list.c | 14 ++++---------- legacy/elementary/src/lib/elm_widget_list.h | 1 - 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/legacy/elementary/src/lib/elm_list.c b/legacy/elementary/src/lib/elm_list.c index 3b0ddd1dc8..3c1446518d 100644 --- a/legacy/elementary/src/lib/elm_list.c +++ b/legacy/elementary/src/lib/elm_list.c @@ -890,6 +890,10 @@ _items_fix(Evas_Object *obj) _elm_list_mode_set_internal(obj); _elm_list_unwalk(obj, sd); + //focus highlight in_theme is set by list item theme. + _elm_widget_item_highlight_in_theme( + obj, elm_list_first_item_get(obj)); + evas_object_unref(obj); } @@ -986,10 +990,6 @@ _elm_list_smart_theme(Eo *obj, void *_pd, va_list *list) _items_fix(obj); - //focus highlight in_theme is set by list item theme. - _elm_widget_item_highlight_in_theme( - obj, elm_list_first_item_get(obj)); - elm_layout_sizing_eval(obj); if (ret) *ret = EINA_TRUE; @@ -2552,12 +2552,6 @@ _item_append(Eo *obj, void *_pd, va_list *list) it = _item_new(obj, label, icon, end, func, data); - if (!sd->in_theme_checked) - { - _elm_widget_item_highlight_in_theme(obj, (Elm_Object_Item *)it); - sd->in_theme_checked = EINA_TRUE; - } - sd->items = eina_list_append(sd->items, it); it->node = eina_list_last(sd->items); elm_box_pack_end(sd->box, VIEW(it)); diff --git a/legacy/elementary/src/lib/elm_widget_list.h b/legacy/elementary/src/lib/elm_widget_list.h index ccef1877fe..06562da29e 100644 --- a/legacy/elementary/src/lib/elm_widget_list.h +++ b/legacy/elementary/src/lib/elm_widget_list.h @@ -53,7 +53,6 @@ struct _Elm_List_Smart_Data Eina_Bool multi : 1; Eina_Bool swipe : 1; Eina_Bool delete_me : 1; - Eina_Bool in_theme_checked : 1; /**< flag for setting item highlight in theme. */ }; typedef struct _Elm_List_Item Elm_List_Item;