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.
This commit is contained in:
parent
8d05e3657e
commit
c4cad315ae
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue