aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-12-21 22:05:28 +0000
committerAndy Williams <andy@andywilliams.me>2017-12-21 22:05:42 +0000
commit14d10e8b7baeaf282ed607d068f84a4d56004519 (patch)
tree651066dc1a52406dcfc28c8b1e5b225293404ac0
parenteolian: unify test directories (diff)
downloadefl-14d10e8b7baeaf282ed607d068f84a4d56004519.tar.gz
elm_code: Cancel selection if clicked outside of the editor area
-rw-r--r--src/lib/elementary/elm_code_widget.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c
index 2f9b693322..394e15885a 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -1179,6 +1179,17 @@ _elm_code_widget_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj E
}
static void
+_elm_code_widget_scroller_clicked_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Elm_Code_Widget *widget;
+
+ widget = (Elm_Code_Widget *)data;
+
+ elm_code_widget_selection_clear(widget);
+}
+
+static void
_elm_code_widget_cursor_move_home(Elm_Code_Widget *widget)
{
Elm_Code_Widget_Data *pd;
@@ -2296,6 +2307,8 @@ _elm_code_widget_efl_canvas_group_group_add(Eo *obj, Elm_Code_Widget_Data *pd)
elm_layout_content_set(obj, "elm.swallow.content", scroller);
elm_object_focus_allow_set(scroller, EINA_FALSE);
pd->scroller = scroller;
+ evas_object_event_callback_add(scroller, EVAS_CALLBACK_MOUSE_DOWN,
+ _elm_code_widget_scroller_clicked_cb, obj);
fontname = edje_object_data_get(elm_layout_edje_get(obj), "font.name");
fontsize = edje_object_data_get(elm_layout_edje_get(obj), "font.size");