From 74c1ceffd80a0d7f2e0063756ff23ed8038eade0 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Fri, 17 Feb 2017 21:47:10 +0100 Subject: [PATCH] win: double click on tab title to change it. Closes T3143 --- data/themes/default.edc | 9 ++++++++- src/bin/win.c | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/data/themes/default.edc b/data/themes/default.edc index 15a843a9..760b9685 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; @@ -1239,6 +1242,10 @@ collections { visible: 1; } } + 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 1d97b8e7..f1697287 100644 --- a/src/bin/win.c +++ b/src/bin/win.c @@ -1717,6 +1717,17 @@ _cb_tab_close(void *data, term_close(win, term->termio, EINA_FALSE); } +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) { @@ -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);