summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/config.c2
-rw-r--r--src/bin/config.h1
-rw-r--r--src/bin/options_behavior.c19
-rw-r--r--src/bin/termio.c5
4 files changed, 25 insertions, 2 deletions
diff --git a/src/bin/config.c b/src/bin/config.c
index d9be869..2244120 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -89,6 +89,8 @@ config_init(void)
89 (edd_base, Config, "cg_width", cg_width, EET_T_INT); 89 (edd_base, Config, "cg_width", cg_width, EET_T_INT);
90 EET_DATA_DESCRIPTOR_ADD_BASIC 90 EET_DATA_DESCRIPTOR_ADD_BASIC
91 (edd_base, Config, "cg_height", cg_height, EET_T_INT); 91 (edd_base, Config, "cg_height", cg_height, EET_T_INT);
92 EET_DATA_DESCRIPTOR_ADD_BASIC
93 (edd_base, Config, "drag_links", drag_links, EET_T_UCHAR);
92} 94}
93 95
94void 96void
diff --git a/src/bin/config.h b/src/bin/config.h
index cda50ff..a40b207 100644
--- a/src/bin/config.h
+++ b/src/bin/config.h
@@ -41,6 +41,7 @@ struct _Config
41 Eina_Bool urg_bell; 41 Eina_Bool urg_bell;
42 Eina_Bool multi_instance; 42 Eina_Bool multi_instance;
43 Eina_Bool custom_geometry; 43 Eina_Bool custom_geometry;
44 Eina_Bool drag_links;
44 int cg_width; 45 int cg_width;
45 int cg_height; 46 int cg_height;
46 47
diff --git a/src/bin/options_behavior.c b/src/bin/options_behavior.c
index 996aa60..00ebcd9 100644
--- a/src/bin/options_behavior.c
+++ b/src/bin/options_behavior.c
@@ -10,6 +10,15 @@
10static Evas_Object *op_w, *op_h; 10static Evas_Object *op_w, *op_h;
11 11
12static void 12static void
13_cb_op_behavior_drag_links_chg(void *data, Evas_Object *obj, void *event EINA_UNUSED)
14{
15 Evas_Object *term = data;
16 Config *config = termio_config_get(term);
17 config->drag_links = elm_check_state_get(obj);
18 config_save(config, NULL);
19}
20
21static void
13_cb_op_behavior_jump_keypress_chg(void *data, Evas_Object *obj, void *event EINA_UNUSED) 22_cb_op_behavior_jump_keypress_chg(void *data, Evas_Object *obj, void *event EINA_UNUSED)
14{ 23{
15 Evas_Object *term = data; 24 Evas_Object *term = data;
@@ -275,6 +284,16 @@ options_behavior(Evas_Object *opbox, Evas_Object *term)
275 evas_object_smart_callback_add(o, "changed", 284 evas_object_smart_callback_add(o, "changed",
276 _cb_op_behavior_custom_geometry, term); 285 _cb_op_behavior_custom_geometry, term);
277 286
287 o = elm_check_add(bx);
288 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
289 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
290 elm_object_text_set(o, "Drag & drop links");
291 elm_check_state_set(o, config->drag_links);
292 elm_box_pack_end(bx, o);
293 evas_object_show(o);
294 evas_object_smart_callback_add(o, "changed",
295 _cb_op_behavior_drag_links_chg, term);
296
278 o = elm_label_add(bx); 297 o = elm_label_add(bx);
279 evas_object_size_hint_weight_set(o, 0.0, 0.0); 298 evas_object_size_hint_weight_set(o, 0.0, 0.0);
280 evas_object_size_hint_align_set(o, 0.0, 0.5); 299 evas_object_size_hint_align_set(o, 0.0, 0.5);
diff --git a/src/bin/termio.c b/src/bin/termio.c
index ffe76af..41bcbfd 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -400,11 +400,12 @@ _cb_link_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event)
400 Termio *sd = evas_object_smart_data_get(data); 400 Termio *sd = evas_object_smart_data_get(data);
401 Evas_Coord dx, dy; 401 Evas_Coord dx, dy;
402 if (!sd) return; 402 if (!sd) return;
403 403
404 if (!sd->link.down.down) return; 404 if (!sd->link.down.down) return;
405 dx = abs(ev->cur.canvas.x - sd->link.down.x); 405 dx = abs(ev->cur.canvas.x - sd->link.down.x);
406 dy = abs(ev->cur.canvas.y - sd->link.down.y); 406 dy = abs(ev->cur.canvas.y - sd->link.down.y);
407 if ((sd->link.string) && 407 if ((sd->config->drag_links) &&
408 (sd->link.string) &&
408 ((dx > elm_config_finger_size_get()) || 409 ((dx > elm_config_finger_size_get()) ||
409 (dy > elm_config_finger_size_get()))) 410 (dy > elm_config_finger_size_get())))
410 { 411 {