summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_code_widget.c
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 /src/lib/elementary/elm_code_widget.c
parent87a93b852134d8b348d5c3615471e8713748966a (diff)
elm_code: Cancel selection if clicked outside of the editor area
Diffstat (limited to '')
-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
1179} 1179}
1180 1180
1181static void 1181static void
1182_elm_code_widget_scroller_clicked_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
1183 void *event_info EINA_UNUSED)
1184{
1185 Elm_Code_Widget *widget;
1186
1187 widget = (Elm_Code_Widget *)data;
1188
1189 elm_code_widget_selection_clear(widget);
1190}
1191
1192static void
1182_elm_code_widget_cursor_move_home(Elm_Code_Widget *widget) 1193_elm_code_widget_cursor_move_home(Elm_Code_Widget *widget)
1183{ 1194{
1184 Elm_Code_Widget_Data *pd; 1195 Elm_Code_Widget_Data *pd;
@@ -2296,6 +2307,8 @@ _elm_code_widget_efl_canvas_group_group_add(Eo *obj, Elm_Code_Widget_Data *pd)
2296 elm_layout_content_set(obj, "elm.swallow.content", scroller); 2307 elm_layout_content_set(obj, "elm.swallow.content", scroller);
2297 elm_object_focus_allow_set(scroller, EINA_FALSE); 2308 elm_object_focus_allow_set(scroller, EINA_FALSE);
2298 pd->scroller = scroller; 2309 pd->scroller = scroller;
2310 evas_object_event_callback_add(scroller, EVAS_CALLBACK_MOUSE_DOWN,
2311 _elm_code_widget_scroller_clicked_cb, obj);
2299 2312
2300 fontname = edje_object_data_get(elm_layout_edje_get(obj), "font.name"); 2313 fontname = edje_object_data_get(elm_layout_edje_get(obj), "font.name");
2301 fontsize = edje_object_data_get(elm_layout_edje_get(obj), "font.size"); 2314 fontsize = edje_object_data_get(elm_layout_edje_get(obj), "font.size");