From e517f5e66027b031608d5603ecaeef34fcb4b3f1 Mon Sep 17 00:00:00 2001 From: Jaeun Choi Date: Tue, 14 Apr 2015 19:20:16 +0900 Subject: [PATCH] elm_gengrid: mark cursor_engine_only in data and update state when realized @fix --- legacy/elementary/src/lib/elm_gen_common.h | 1 + legacy/elementary/src/lib/elm_gengrid.c | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/legacy/elementary/src/lib/elm_gen_common.h b/legacy/elementary/src/lib/elm_gen_common.h index ec36ce9..74b13ae 100644 --- a/legacy/elementary/src/lib/elm_gen_common.h +++ b/legacy/elementary/src/lib/elm_gen_common.h @@ -66,6 +66,7 @@ struct Elm_Gen_Item Eina_Bool decorate_it_set : 1; /**< item uses style mode for highlight/select */ Eina_Bool flipped : 1; /**< a flag that shows the flip status of the item. */ Eina_Bool has_contents : 1; /**< content objs have or previously did exist (size calcs) */ + Eina_Bool cursor_engine_only : 1; }; #endif diff --git a/legacy/elementary/src/lib/elm_gengrid.c b/legacy/elementary/src/lib/elm_gengrid.c index bb2b92a..9a4937e 100644 --- a/legacy/elementary/src/lib/elm_gengrid.c +++ b/legacy/elementary/src/lib/elm_gengrid.c @@ -1014,6 +1014,9 @@ _item_realize(Elm_Gen_Item *it) if (it->mouse_cursor) eo_do(eo_it, elm_wdg_item_cursor_set(it->mouse_cursor)); + if (it->cursor_engine_only) + eo_do(eo_it, elm_wdg_item_cursor_engine_only_set(it->cursor_engine_only)); + if (eo_it == sd->focused_item) { const char *focus_raise; @@ -4430,17 +4433,23 @@ elm_gengrid_item_cursor_style_get(const Elm_Object_Item *it) } EAPI void -elm_gengrid_item_cursor_engine_only_set(Elm_Object_Item *it, +elm_gengrid_item_cursor_engine_only_set(Elm_Object_Item *eo_it, Eina_Bool engine_only) { - eo_do(it, elm_wdg_item_cursor_engine_only_set(engine_only)); + ELM_GENGRID_ITEM_DATA_GET(eo_it, it); + it->cursor_engine_only = engine_only; + if (it->realized) + eo_do(eo_it, elm_wdg_item_cursor_engine_only_set(engine_only)); } EAPI Eina_Bool -elm_gengrid_item_cursor_engine_only_get(const Elm_Object_Item *it) +elm_gengrid_item_cursor_engine_only_get(const Elm_Object_Item *eo_it) { + ELM_GENGRID_ITEM_DATA_GET(eo_it, it); Eina_Bool ret; - return eo_do_ret(it, ret, elm_wdg_item_cursor_engine_only_get()); + if (it->realized) + return eo_do_ret(eo_it, ret, elm_wdg_item_cursor_engine_only_get()); + else return it->cursor_engine_only; } EAPI void -- 2.7.4