add option to hide top tab bar on launch

This commit is contained in:
Boris Faure 2014-11-29 22:28:20 +01:00
parent fb6b7e9f75
commit 9abf95c981
4 changed files with 19 additions and 8 deletions

View File

@ -160,6 +160,8 @@ config_init(void)
(edd_base, Config, "keys", keys, edd_keys);
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_base, Config, "gravatar", gravatar, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_base, Config, "hide_top_tabbar", hide_top_tabbar, EET_T_UCHAR);
}
void
@ -259,6 +261,7 @@ config_sync(const Config *config_src, Config *config)
config->mouse_over_focus = config_src->mouse_over_focus;
/* TODO: config->keys */
config->gravatar = config_src->gravatar;
config->hide_top_tabbar = config_src->hide_top_tabbar;
}
static void
@ -527,6 +530,7 @@ config_load(const char *key)
config->mouse_over_focus = EINA_TRUE;
config->colors_use = EINA_FALSE;
config->gravatar = EINA_TRUE;
config->hide_top_tabbar = EINA_FALSE;
for (j = 0; j < 4; j++)
{
for (i = 0; i < 12; i++)
@ -616,6 +620,7 @@ config_fork(Config *config)
SCPY(config_key);
CPY(font_set);
CPY(gravatar);
CPY(hide_top_tabbar);
EINA_LIST_FOREACH(config->keys, l, key)
{

View File

@ -73,6 +73,7 @@ struct _Config
Eina_Bool mouse_over_focus;
Eina_Bool colors_use;
Eina_Bool gravatar;
Eina_Bool hide_top_tabbar;
Config_Color colors[(4 * 12)];
Eina_List *keys;

View File

@ -38,7 +38,8 @@ CB(erase_is_del, 0);
CB(drag_links, 0);
CB(login_shell, 0);
CB(mouse_over_focus, 0);
CB(gravatar, 0);
CB(gravatar, 0);
CB(hide_top_tabbar, 0);
#undef CB
@ -247,6 +248,7 @@ options_behavior(Evas_Object *opbox, Evas_Object *term)
CX(_("Start as login shell"), login_shell, 0);
CX(_("Focus split under the Mouse"), mouse_over_focus, 0);
CX(_("Gravatar integration"), gravatar, 0);
CX(_("Hide top tab bar on launch"), hide_top_tabbar, 0);
/*
CX(_("Enable application server"), application_server, 0);

View File

@ -2651,9 +2651,9 @@ _cb_tabbar_show(void *data, Evas_Object *obj EINA_UNUSED,
}
static void
_tab_hide_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
_tabs_hide_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Evas_Coord w = 0, h = 0;
Tabs *tabs = data;
@ -2873,9 +2873,6 @@ _tabs_new(Term_Container *child, Term_Container *parent)
elm_box_horizontal_set(o, EINA_TRUE);
tabs->tabbar = o = elm_toolbar_add(wn->win);
DBG("style:%s", elm_object_style_get(o));
elm_object_style_set(o, "transparent");
DBG("style:%s", elm_object_style_get(o));
elm_toolbar_homogeneous_set(o, EINA_FALSE);
elm_toolbar_shrink_mode_set(o, ELM_TOOLBAR_SHRINK_EXPAND);
elm_toolbar_transverse_expanded_set(o, EINA_TRUE);
@ -2897,7 +2894,7 @@ _tabs_new(Term_Container *child, Term_Container *parent)
elm_object_part_content_set(o, "icon", ic);
elm_box_pack_end(tabs->box, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "clicked", _tab_hide_cb, tabs);
evas_object_smart_callback_add(o, "clicked", _tabs_hide_cb, tabs);
child->parent = tc;
tab_item_new(tabs, child);
@ -2916,6 +2913,12 @@ _tabs_new(Term_Container *child, Term_Container *parent)
edje_object_signal_callback_add(tabs->base, "tabselector,show", "terminology",
_cb_tab_selector_show, tabs);
if (((parent->type == TERM_CONTAINER_TYPE_WIN) &&
wn->config->hide_top_tabbar) ||
(parent->type != TERM_CONTAINER_TYPE_WIN))
{
_tabs_hide_cb(tabs, NULL, NULL);
}
return tc;
}