aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/win.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2015-09-14 23:01:32 +0200
committerBoris Faure <billiob@gmail.com>2015-09-14 23:01:32 +0200
commite8bd673f209b4c96390510d801ccd96e7ecf48cf (patch)
treee910045421819519613498a59242ec019a77484f /src/bin/win.c
parentctrl-[2-8] are now handled by terminology. Ref T2723 (diff)
downloadterminology-e8bd673f209b4c96390510d801ccd96e7ecf48cf.tar.gz
send ctrl[1-0] to term if "going to tab#" is not possible. Closes https://phab.enlightenment.org/T2723
Diffstat (limited to 'src/bin/win.c')
-rw-r--r--src/bin/win.c42
1 files changed, 6 insertions, 36 deletions
diff --git a/src/bin/win.c b/src/bin/win.c
index bb2b17b..a37aaa5 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -1708,8 +1708,8 @@ _tabbar_fill(Tabs *tabs)
}
}
-static void
-_tab_go(Term *term, int tnum)
+Eina_Bool
+term_tab_go(Term *term, int tnum)
{
Term_Container *tc = term->container,
*child = tc;
@@ -1733,33 +1733,13 @@ _tab_go(Term *term, int tnum)
tc = tc->parent;
continue;
}
- if (tab_item == tabs->current)
- return;
- tab_item->tc->focus(tab_item->tc, child);
- return;
+ if (tab_item != tabs->current)
+ tab_item->tc->focus(tab_item->tc, child);
+ return EINA_TRUE;
}
+ return EINA_FALSE;
}
-#define CB_TAB(TAB) \
-static void \
-_cb_tab_##TAB(void *data, Evas_Object *obj EINA_UNUSED, \
- void *event EINA_UNUSED) \
-{ \
- _tab_go(data, TAB - 1); \
-}
-
-CB_TAB(1)
-CB_TAB(2)
-CB_TAB(3)
-CB_TAB(4)
-CB_TAB(5)
-CB_TAB(6)
-CB_TAB(7)
-CB_TAB(8)
-CB_TAB(9)
-CB_TAB(10)
-#undef CB_TAB
-
static void
_tabs_selector_cb_selected(void *data,
Evas_Object *obj EINA_UNUSED,
@@ -4092,16 +4072,6 @@ term_new(Win *wn, Config *config, const char *cmd,
evas_object_smart_callback_add(o, "split,v", _cb_split_v, term);
evas_object_smart_callback_add(o, "title,change", _cb_title, term);
evas_object_smart_callback_add(o, "icon,change", _cb_icon, term);
- evas_object_smart_callback_add(o, "tab,1", _cb_tab_1, term);
- evas_object_smart_callback_add(o, "tab,2", _cb_tab_2, term);
- evas_object_smart_callback_add(o, "tab,3", _cb_tab_3, term);
- evas_object_smart_callback_add(o, "tab,4", _cb_tab_4, term);
- evas_object_smart_callback_add(o, "tab,5", _cb_tab_5, term);
- evas_object_smart_callback_add(o, "tab,6", _cb_tab_6, term);
- evas_object_smart_callback_add(o, "tab,7", _cb_tab_7, term);
- evas_object_smart_callback_add(o, "tab,8", _cb_tab_8, term);
- evas_object_smart_callback_add(o, "tab,9", _cb_tab_9, term);
- evas_object_smart_callback_add(o, "tab,0", _cb_tab_10, term);
evas_object_show(o);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,