Looks for parent cursors when mouse out a subobj
It will set the parent cursor if it should be visible. SVN revision: 52848
This commit is contained in:
parent
dc9887471c
commit
0bae5b3b96
|
@ -94,6 +94,7 @@ void
|
||||||
test_cursor(void *data, Evas_Object *obj, void *event_info)
|
test_cursor(void *data, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
Evas_Object *win, *bg, *bx, *bt, *list, *entry, *ck;
|
Evas_Object *win, *bg, *bx, *bt, *list, *entry, *ck;
|
||||||
|
Elm_List_Item *lit;
|
||||||
|
|
||||||
win = elm_win_add(NULL, "cursor", ELM_WIN_BASIC);
|
win = elm_win_add(NULL, "cursor", ELM_WIN_BASIC);
|
||||||
elm_win_title_set(win, "Cursor");
|
elm_win_title_set(win, "Cursor");
|
||||||
|
@ -133,8 +134,12 @@ test_cursor(void *data, Evas_Object *obj, void *event_info)
|
||||||
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_fill_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_fill_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
elm_object_cursor_set(list, ELM_CURSOR_WATCH);
|
elm_object_cursor_set(list, ELM_CURSOR_WATCH);
|
||||||
elm_list_item_append(list, "watch over list", NULL, NULL, NULL, NULL);
|
lit = elm_list_item_append(list, "watch over list | hand1", NULL, NULL, NULL,
|
||||||
elm_list_item_append(list, "watch over list", NULL, NULL, NULL, NULL);
|
NULL);
|
||||||
|
elm_list_item_cursor_set(lit, ELM_CURSOR_HAND1);
|
||||||
|
lit = elm_list_item_append(list, "watch over list | hand2", NULL, NULL, NULL,
|
||||||
|
NULL);
|
||||||
|
elm_list_item_cursor_set(lit, ELM_CURSOR_HAND2);
|
||||||
elm_list_go(list);
|
elm_list_go(list);
|
||||||
evas_object_show(list);
|
evas_object_show(list);
|
||||||
|
|
||||||
|
|
|
@ -228,11 +228,31 @@ _elm_cursor_mouse_in(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSE
|
||||||
static void
|
static void
|
||||||
_elm_cursor_mouse_out(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
_elm_cursor_mouse_out(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||||
{
|
{
|
||||||
|
Evas_Object *sobj_parent;
|
||||||
|
Elm_Cursor *pcur = NULL;
|
||||||
Elm_Cursor *cur = data;
|
Elm_Cursor *cur = data;
|
||||||
|
|
||||||
if (!cur->visible) return;
|
if (!cur->visible) return;
|
||||||
evas_event_freeze(cur->evas);
|
evas_event_freeze(cur->evas);
|
||||||
cur->visible = EINA_FALSE;
|
cur->visible = EINA_FALSE;
|
||||||
|
|
||||||
|
sobj_parent = evas_object_data_get(cur->eventarea, "elm-parent");
|
||||||
|
while (sobj_parent != NULL)
|
||||||
|
{
|
||||||
|
pcur = evas_object_data_get((sobj_parent), _cursor_key);
|
||||||
|
if (pcur && pcur->visible)
|
||||||
|
break;
|
||||||
|
sobj_parent = evas_object_data_get(sobj_parent, "elm-parent");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pcur)
|
||||||
|
{
|
||||||
|
pcur->visible = EINA_FALSE;
|
||||||
|
evas_event_thaw(cur->evas);
|
||||||
|
_elm_cursor_mouse_in(pcur, NULL, NULL, NULL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ((!cur->engine_only) || (!cur->use_engine))
|
if ((!cur->engine_only) || (!cur->use_engine))
|
||||||
{
|
{
|
||||||
ecore_evas_object_cursor_set(cur->ee, NULL, ELM_OBJECT_LAYER_CURSOR,
|
ecore_evas_object_cursor_set(cur->ee, NULL, ELM_OBJECT_LAYER_CURSOR,
|
||||||
|
|
Loading…
Reference in New Issue