elm/genlist: fix item highlight/unhighlight eventing on clicks

* highlight should only be triggered on mouse down, as that is the point of
  interaction with an item which indicates it is "in use"; a mouse-up event
  cannot occur on an item which has not previously received a mouse-down event,
  so toggling this on mouse-up will be wrong/duplicated 100% of the time
* unhighlight should only be triggered during mouse-up events if the list is
  in no-select mode, as it will otherwise be implicitly during selection if
  necessary

this should ensure that these events are emitted exactly one time and correctly
for each click event

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10517
This commit is contained in:
Mike Blumenkrantz 2019-10-21 11:02:18 -04:00
parent 62615650f5
commit d088dcbe69
1 changed files with 8 additions and 1 deletions

View File

@ -5168,7 +5168,10 @@ _item_mouse_up_cb(void *data,
}
}
if (!it->selected && it->highlighted)
/* this is handled implicitly in _item_unselect() below unless there
* will be no select
*/
if (!it->selected && it->highlighted && _is_no_select(it))
_item_unhighlight(it);
if ((ev->flags != EVAS_BUTTON_NONE) ||
@ -5191,7 +5194,9 @@ _item_mouse_up_cb(void *data,
{
if (!it->selected)
{
/* this should only be handled on mouse down
_item_highlight(it);
*/
if (_item_select(it)) goto deleted;
}
else
@ -5220,7 +5225,9 @@ _item_mouse_up_cb(void *data,
_item_unselect(it2);
}
}
/* this should only be handled on mouse down
_item_highlight(it);
*/
if (_item_select(it)) goto deleted;
}