aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2017-02-17 21:47:10 +0100
committerBoris Faure <billiob@gmail.com>2017-02-17 21:47:57 +0100
commit74c1ceffd80a0d7f2e0063756ff23ed8038eade0 (patch)
tree6e615c658c531d1b2cedfac6e133e28c072e10aa
parentcontrols: clean up code (diff)
downloadterminology-74c1ceffd80a0d7f2e0063756ff23ed8038eade0.tar.gz
win: double click on tab title to change it. Closes https://phab.enlightenment.org/T3143
-rw-r--r--data/themes/default.edc9
-rw-r--r--src/bin/win.c15
2 files changed, 23 insertions, 1 deletions
diff --git a/data/themes/default.edc b/data/themes/default.edc
index 15a843a..760b968 100644
--- a/data/themes/default.edc
+++ b/data/themes/default.edc
@@ -1137,7 +1137,10 @@ collections {
fixed: 1 1;
}
}
- part { name: "tabtitle"; type: TEXT; mouse_events: 0;
+ part {
+ name: "tabtitle";
+ type: TEXT;
+ mouse_events: 0;
scale: 1;
effect: SOFT_SHADOW BOTTOM;
description { state: "default" 0.0;
@@ -1240,6 +1243,10 @@ collections {
}
}
program {
+ signal: "mouse,down,1,double"; source: "tabmiddle";
+ action: SIGNAL_EMIT "tab,title" "terminology";
+ }
+ program {
signal: "mouse,clicked,1"; source: "tabclose";
action: SIGNAL_EMIT "tab,close" "terminology";
}
diff --git a/src/bin/win.c b/src/bin/win.c
index 1d97b8e..f169728 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -1718,6 +1718,17 @@ _cb_tab_close(void *data,
}
static void
+_cb_tab_title(void *data,
+ Evas_Object *_obj EINA_UNUSED,
+ const char *_sig EINA_UNUSED,
+ const char *_src EINA_UNUSED)
+{
+ Term *term = data;
+
+ term_set_title(term);
+}
+
+static void
_tabbar_fill(Tabs *tabs)
{
Eina_List *l;
@@ -1797,6 +1808,8 @@ _tabbar_fill(Tabs *tabs)
_cb_tab_activate, tab_item);
edje_object_signal_callback_add(o, "tab,close", "terminology",
_cb_tab_close, term);
+ edje_object_signal_callback_add(o, "tab,title", "terminology",
+ _cb_tab_title, term);
}
j++;
}
@@ -4025,6 +4038,8 @@ _term_bg_config(Term *term)
_cb_tabcount_next, term);
edje_object_signal_callback_add(term->bg, "tab,close", "terminology",
_cb_tab_close, term);
+ edje_object_signal_callback_add(term->bg, "tab,title", "terminology",
+ _cb_tab_title, term);
edje_object_part_swallow(term->base, "terminology.content", term->termio);
edje_object_part_swallow(term->bg, "terminology.content", term->base);
edje_object_part_swallow(term->bg, "terminology.miniview", term->miniview);