forked from enlightenment/efl
efl.ui.textbox: prevent longpress + right click from working on scrollbars
summary_: Longpress and right click one textbox scrollbars will not show up the menu. Reviewers: woohyun, bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8604 Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11295
This commit is contained in:
parent
ea3c30ca1e
commit
6ce2698bb5
|
@ -1049,11 +1049,31 @@ _menu_call(Evas_Object *obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
_is_pointer_inside_viewport(Eo *textbox,Efl_Ui_Textbox_Data *sd)
|
||||||
|
{
|
||||||
|
if (sd->scroller)
|
||||||
|
{
|
||||||
|
Eo *top = efl_provider_find(textbox, EFL_UI_WIN_CLASS);
|
||||||
|
Eina_Position2D pos = {0};
|
||||||
|
if (efl_canvas_scene_pointer_position_get(top, NULL, &pos))
|
||||||
|
{
|
||||||
|
Eina_Rect rc = efl_ui_scrollable_viewport_geometry_get(sd->scroller);
|
||||||
|
if (!eina_rectangle_coords_inside(&rc.rect, pos.x, pos.y))
|
||||||
|
return EINA_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return EINA_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_long_press_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
_long_press_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||||
{
|
{
|
||||||
EFL_UI_TEXT_DATA_GET(data, sd);
|
EFL_UI_TEXT_DATA_GET(data, sd);
|
||||||
|
|
||||||
|
if (!_is_pointer_inside_viewport(data, sd))
|
||||||
|
return;
|
||||||
|
|
||||||
/* Context menu will not appear if context menu disabled is set
|
/* Context menu will not appear if context menu disabled is set
|
||||||
* as false on a long press callback */
|
* as false on a long press callback */
|
||||||
if (!_elm_config->context_menu_disabled &&
|
if (!_elm_config->context_menu_disabled &&
|
||||||
|
@ -1122,6 +1142,8 @@ _mouse_down_cb(void *data, const Efl_Event *event)
|
||||||
{
|
{
|
||||||
if (_elm_config->desktop_entry)
|
if (_elm_config->desktop_entry)
|
||||||
{
|
{
|
||||||
|
if (!_is_pointer_inside_viewport(data, sd))
|
||||||
|
return;
|
||||||
sd->use_down = 1;
|
sd->use_down = 1;
|
||||||
_menu_call(data);
|
_menu_call(data);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue