keybindings: fix binding to close focused term

This commit is contained in:
Boris Faure 2016-05-22 20:45:13 +02:00
parent 0c466d767c
commit cd0f61dd26
2 changed files with 13 additions and 3 deletions

View File

@ -458,9 +458,9 @@ cb_tab_new(Evas_Object *termio_obj)
}
static Eina_Bool
cb_exited(Evas_Object *termio_obj)
cb_close(Evas_Object *termio_obj)
{
evas_object_smart_callback_call(termio_obj, "exited", NULL);
evas_object_smart_callback_call(termio_obj, "close", NULL);
return EINA_TRUE;
}
@ -624,7 +624,7 @@ static Shortcut_Action _actions[] =
{"split_h", gettext_noop("Split horizontally (new below)"), cb_split_h},
{"split_v", gettext_noop("Split vertically (new on right)"), cb_split_v},
{"tab_new", gettext_noop("Create a new \"tab\""), cb_tab_new},
{"exited", gettext_noop("Close the focused terminal"), cb_exited},
{"exited", gettext_noop("Close the focused terminal"), cb_close},
{"tab_select", gettext_noop("Bring up \"tab\" switcher"), cb_tab_select},
{"tab_1", gettext_noop("Switch to terminal tab 1"), cb_tab_1},
{"tab_2", gettext_noop("Switch to terminal tab 2"), cb_tab_2},

View File

@ -2405,6 +2405,15 @@ _cb_new(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
_solo_tabs_new(tc);
}
static void
_cb_close(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
Term *term = data;
Term_Container *tc = term->container;
term_close(tc->wn->win, term->termio, EINA_FALSE);
}
void
main_new(Evas_Object *win EINA_UNUSED, Evas_Object *term)
{
@ -4200,6 +4209,7 @@ term_new(Win *wn, Config *config, const char *cmd,
evas_object_smart_callback_add(o, "prev", _cb_prev, term);
evas_object_smart_callback_add(o, "next", _cb_next, term);
evas_object_smart_callback_add(o, "new", _cb_new, term);
evas_object_smart_callback_add(o, "close", _cb_close, term);
evas_object_smart_callback_add(o, "select", _cb_select, term);
evas_object_smart_callback_add(o, "split,h", _cb_split_h, term);
evas_object_smart_callback_add(o, "split,v", _cb_split_v, term);