From 9abf95c981597ca27c3ac5767a3fe4a79d0f7a0b Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Sat, 29 Nov 2014 22:28:20 +0100 Subject: [PATCH] add option to hide top tab bar on launch --- src/bin/config.c | 5 +++++ src/bin/config.h | 1 + src/bin/options_behavior.c | 4 +++- src/bin/win.c | 17 ++++++++++------- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/bin/config.c b/src/bin/config.c index 8f3d432d..948b13ae 100644 --- a/src/bin/config.c +++ b/src/bin/config.c @@ -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) { diff --git a/src/bin/config.h b/src/bin/config.h index f933b280..0b489884 100644 --- a/src/bin/config.h +++ b/src/bin/config.h @@ -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; diff --git a/src/bin/options_behavior.c b/src/bin/options_behavior.c index 48f05a77..4d5c5d0c 100644 --- a/src/bin/options_behavior.c +++ b/src/bin/options_behavior.c @@ -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); diff --git a/src/bin/win.c b/src/bin/win.c index cc40aea2..afc0e074 100644 --- a/src/bin/win.c +++ b/src/bin/win.c @@ -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; }