glima pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=a50fdbc2bb89eb9d7daba246b806874446cccac1

commit a50fdbc2bb89eb9d7daba246b806874446cccac1
Author: Guilherme Iscaro de Godoy <guilherme.isc...@intel.com>
Date:   Wed Mar 12 10:02:17 2014 -0300

    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.
---
 src/lib/elm_list.c        | 14 ++++----------
 src/lib/elm_widget_list.h |  1 -
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 3b0ddd1..3c14465 100644
--- a/src/lib/elm_list.c
+++ b/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/src/lib/elm_widget_list.h b/src/lib/elm_widget_list.h
index ccef187..06562da 100644
--- a/src/lib/elm_widget_list.h
+++ b/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;

-- 


Reply via email to