summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2019-09-29 23:03:12 +0200
committerBoris Faure <billiob@gmail.com>2019-09-30 21:55:47 +0200
commitdc1ddf7e405b8c1a99f8a1cb270c84840531e983 (patch)
treef45ff62de3164cf8adf9ef451f7d1f8b772f4157 /src
parent5996e5eb2cb5e3481b1258cba965afd00722c8bf (diff)
config: turn "notabs" into "show_tabs"
Diffstat (limited to 'src')
-rw-r--r--src/bin/config.c18
-rw-r--r--src/bin/config.h3
-rw-r--r--src/bin/options_behavior.c5
-rw-r--r--src/bin/win.c20
4 files changed, 27 insertions, 19 deletions
diff --git a/src/bin/config.c b/src/bin/config.c
index 9cb4fa2..52ff2d2 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -7,7 +7,7 @@
7#include "col.h" 7#include "col.h"
8#include "utils.h" 8#include "utils.h"
9 9
10#define CONF_VER 22 10#define CONF_VER 23
11#define CONFIG_KEY "config" 11#define CONFIG_KEY "config"
12 12
13#define LIM(v, min, max) {if (v >= max) v = max; else if (v <= min) v = min;} 13#define LIM(v, min, max) {if (v >= max) v = max; else if (v <= min) v = min;}
@@ -175,9 +175,11 @@ config_init(void)
175 (edd_base, Config, "keys", keys, edd_keys); 175 (edd_base, Config, "keys", keys, edd_keys);
176 EET_DATA_DESCRIPTOR_ADD_BASIC 176 EET_DATA_DESCRIPTOR_ADD_BASIC
177 (edd_base, Config, "gravatar", gravatar, EET_T_UCHAR); 177 (edd_base, Config, "gravatar", gravatar, EET_T_UCHAR);
178 EET_DATA_DESCRIPTOR_ADD_BASIC 178 EET_DATA_DESCRIPTOR_ADD_BASIC /* DEPRECATED, NO LONGER USED */
179 (edd_base, Config, "notabs", notabs, EET_T_UCHAR); 179 (edd_base, Config, "notabs", notabs, EET_T_UCHAR);
180 EET_DATA_DESCRIPTOR_ADD_BASIC 180 EET_DATA_DESCRIPTOR_ADD_BASIC
181 (edd_base, Config, "show_tabs", show_tabs, EET_T_UCHAR);
182 EET_DATA_DESCRIPTOR_ADD_BASIC
181 (edd_base, Config, "mv_always_show", mv_always_show, EET_T_UCHAR); 183 (edd_base, Config, "mv_always_show", mv_always_show, EET_T_UCHAR);
182 EET_DATA_DESCRIPTOR_ADD_BASIC 184 EET_DATA_DESCRIPTOR_ADD_BASIC
183 (edd_base, Config, "ty_escapes", ty_escapes, EET_T_UCHAR); 185 (edd_base, Config, "ty_escapes", ty_escapes, EET_T_UCHAR);
@@ -292,7 +294,7 @@ config_sync(const Config *config_src, Config *config)
292 config->disable_focus_visuals = config_src->disable_focus_visuals; 294 config->disable_focus_visuals = config_src->disable_focus_visuals;
293 /* TODO: config->keys */ 295 /* TODO: config->keys */
294 config->gravatar = config_src->gravatar; 296 config->gravatar = config_src->gravatar;
295 config->notabs = config_src->notabs; 297 config->show_tabs = config_src->show_tabs;
296 config->mv_always_show = config_src->mv_always_show; 298 config->mv_always_show = config_src->mv_always_show;
297 config->ty_escapes = config_src->ty_escapes; 299 config->ty_escapes = config_src->ty_escapes;
298 config->changedir_to_current = config_src->changedir_to_current; 300 config->changedir_to_current = config_src->changedir_to_current;
@@ -554,7 +556,7 @@ config_new(void)
554 config->disable_focus_visuals = EINA_FALSE; 556 config->disable_focus_visuals = EINA_FALSE;
555 config->colors_use = EINA_FALSE; 557 config->colors_use = EINA_FALSE;
556 config->gravatar = EINA_TRUE; 558 config->gravatar = EINA_TRUE;
557 config->notabs = EINA_FALSE; 559 config->show_tabs = EINA_TRUE;
558 config->mv_always_show = EINA_FALSE; 560 config->mv_always_show = EINA_FALSE;
559 config->ty_escapes = EINA_TRUE; 561 config->ty_escapes = EINA_TRUE;
560 config->changedir_to_current = EINA_TRUE; 562 config->changedir_to_current = EINA_TRUE;
@@ -705,7 +707,11 @@ config_load(void)
705 config->hide_cursor = 5.0; 707 config->hide_cursor = 5.0;
706 EINA_FALLTHROUGH; 708 EINA_FALLTHROUGH;
707 /*pass through*/ 709 /*pass through*/
708 case CONF_VER: /* 22 */ 710 case 22:
711 config->show_tabs = !config->notabs;
712 EINA_FALLTHROUGH;
713 /*pass through*/
714 case CONF_VER: /* 23 */
709 config->version = CONF_VER; 715 config->version = CONF_VER;
710 break; 716 break;
711 default: 717 default:
@@ -801,7 +807,7 @@ config_fork(const Config *config)
801 CPY(temporary); 807 CPY(temporary);
802 CPY(font_set); 808 CPY(font_set);
803 CPY(gravatar); 809 CPY(gravatar);
804 CPY(notabs); 810 CPY(show_tabs);
805 CPY(mv_always_show); 811 CPY(mv_always_show);
806 CPY(ty_escapes); 812 CPY(ty_escapes);
807 CPY(changedir_to_current); 813 CPY(changedir_to_current);
diff --git a/src/bin/config.h b/src/bin/config.h
index b74a4a9..aa3027b 100644
--- a/src/bin/config.h
+++ b/src/bin/config.h
@@ -89,7 +89,8 @@ struct _Config
89 Eina_Bool disable_focus_visuals; 89 Eina_Bool disable_focus_visuals;
90 Eina_Bool colors_use; 90 Eina_Bool colors_use;
91 Eina_Bool gravatar; 91 Eina_Bool gravatar;
92 Eina_Bool notabs; 92 Eina_Bool notabs; /* DEPRECATED */
93 Eina_Bool show_tabs;
93 Eina_Bool mv_always_show; 94 Eina_Bool mv_always_show;
94 Eina_Bool ty_escapes; 95 Eina_Bool ty_escapes;
95 Eina_Bool changedir_to_current; 96 Eina_Bool changedir_to_current;
diff --git a/src/bin/options_behavior.c b/src/bin/options_behavior.c
index 4fb0c9b..4f1bf33 100644
--- a/src/bin/options_behavior.c
+++ b/src/bin/options_behavior.c
@@ -1,5 +1,6 @@
1#include "private.h" 1#include "private.h"
2 2
3
3#include <math.h> 4#include <math.h>
4#include <Elementary.h> 5#include <Elementary.h>
5#include <assert.h> 6#include <assert.h>
@@ -55,7 +56,7 @@ CB(login_shell, 0);
55CB(mouse_over_focus, 0); 56CB(mouse_over_focus, 0);
56CB(disable_focus_visuals, 1); 57CB(disable_focus_visuals, 1);
57CB(gravatar, 0); 58CB(gravatar, 0);
58CB(notabs, 1); 59CB(show_tabs, 0);
59CB(mv_always_show, 0); 60CB(mv_always_show, 0);
60CB(ty_escapes, 0); 61CB(ty_escapes, 0);
61CB(changedir_to_current, 0); 62CB(changedir_to_current, 0);
@@ -482,7 +483,7 @@ options_behavior(Evas_Object *opbox, Evas_Object *term)
482 CX(_("Focus split under the Mouse"), mouse_over_focus, 0); 483 CX(_("Focus split under the Mouse"), mouse_over_focus, 0);
483 CX(_("Focus-related visuals"), disable_focus_visuals, 1); 484 CX(_("Focus-related visuals"), disable_focus_visuals, 1);
484 CX(_("Gravatar integration"), gravatar, 0); 485 CX(_("Gravatar integration"), gravatar, 0);
485 CX(_("Show tabs"), notabs, 1); 486 CX(_("Show tabs"), show_tabs, 0);
486 CX(_("Always show miniview"), mv_always_show, 0); 487 CX(_("Always show miniview"), mv_always_show, 0);
487 CX(_("Enable special Terminology escape codes"), ty_escapes, 0); 488 CX(_("Enable special Terminology escape codes"), ty_escapes, 0);
488 CX(_("Open new terminals in current working directory"), changedir_to_current, 0); 489 CX(_("Open new terminals in current working directory"), changedir_to_current, 0);
diff --git a/src/bin/win.c b/src/bin/win.c
index 8a0124f..0d5ca46 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -517,7 +517,7 @@ _solo_set_title(Term_Container *tc,
517 517
518 eina_stringshare_del(tc->title); 518 eina_stringshare_del(tc->title);
519 tc->title = eina_stringshare_add(title); 519 tc->title = eina_stringshare_add(title);
520 if (!term->config->notabs) 520 if (term->config->show_tabs)
521 { 521 {
522 edje_object_part_text_set(term->bg, "terminology.tab.title", 522 edje_object_part_text_set(term->bg, "terminology.tab.title",
523 title); 523 title);
@@ -1164,7 +1164,7 @@ _win_swallow(Term_Container *tc, Term_Container *orig,
1164 elm_layout_content_set(wn->base, "terminology.content", o); 1164 elm_layout_content_set(wn->base, "terminology.content", o);
1165 1165
1166 if ((new_child->type == TERM_CONTAINER_TYPE_SOLO 1166 if ((new_child->type == TERM_CONTAINER_TYPE_SOLO
1167 && (!wn->config->notabs))) 1167 && (wn->config->show_tabs)))
1168 { 1168 {
1169 _solo_title_hide(new_child); 1169 _solo_title_hide(new_child);
1170 } 1170 }
@@ -1343,7 +1343,7 @@ _win_split(Term_Container *tc, Term_Container *child,
1343 elm_layout_content_unset(wn->base, "terminology.content"); 1343 elm_layout_content_unset(wn->base, "terminology.content");
1344 1344
1345 tc_split = _split_new(child, tc_solo_new, is_horizontal); 1345 tc_split = _split_new(child, tc_solo_new, is_horizontal);
1346 if (!wn->config->notabs) 1346 if (wn->config->show_tabs)
1347 { 1347 {
1348 if (child->type == TERM_CONTAINER_TYPE_SOLO) 1348 if (child->type == TERM_CONTAINER_TYPE_SOLO)
1349 { 1349 {
@@ -2590,7 +2590,7 @@ _split_split(Term_Container *tc, Term_Container *child,
2590 tc_split->is_focused = tc->is_focused; 2590 tc_split->is_focused = tc->is_focused;
2591 tc->swallow(tc, child, tc_split); 2591 tc->swallow(tc, child, tc_split);
2592 2592
2593 if (!wn->config->notabs) 2593 if (wn->config->show_tabs)
2594 { 2594 {
2595 _solo_title_show(tc_solo_new); 2595 _solo_title_show(tc_solo_new);
2596 } 2596 }
@@ -3252,7 +3252,7 @@ _tabs_size_eval(Term_Container *container, Sizeinfo *info)
3252 config = tc->wn->config; 3252 config = tc->wn->config;
3253 tc->size_eval(tc, info); 3253 tc->size_eval(tc, info);
3254 /* Current sizing code does not take the tab area correctly into account */ 3254 /* Current sizing code does not take the tab area correctly into account */
3255 if (!config->notabs) 3255 if (config->show_tabs)
3256 { 3256 {
3257 info->step_x = 1; 3257 info->step_x = 1;
3258 info->step_y = 1; 3258 info->step_y = 1;
@@ -3322,12 +3322,12 @@ _tabs_close(Term_Container *tc, Term_Container *child)
3322 config = next_term->config; 3322 config = next_term->config;
3323 3323
3324 edje_object_signal_emit(next_term->bg, "tabcount,off", "terminology"); 3324 edje_object_signal_emit(next_term->bg, "tabcount,off", "terminology");
3325 if (next_term->tabcount_spacer && config->notabs) 3325 if (next_term->tabcount_spacer && !config->show_tabs)
3326 { 3326 {
3327 evas_object_del(next_term->tabcount_spacer); 3327 evas_object_del(next_term->tabcount_spacer);
3328 next_term->tabcount_spacer = NULL; 3328 next_term->tabcount_spacer = NULL;
3329 } 3329 }
3330 if (!config->notabs) 3330 if (config->show_tabs)
3331 _solo_title_show(next_child); 3331 _solo_title_show(next_child);
3332 3332
3333 if (tabs->selector) 3333 if (tabs->selector)
@@ -3685,7 +3685,7 @@ _tabs_focus(Term_Container *tc, Term_Container *relative)
3685 Config *config = tc->wn->config; 3685 Config *config = tc->wn->config;
3686 tabs->current->tc->unfocus(tabs->current->tc, tc); 3686 tabs->current->tc->unfocus(tabs->current->tc, tc);
3687 3687
3688 if (config->tab_zoom >= 0.01 && config->notabs) 3688 if (config->tab_zoom >= 0.01 && !config->show_tabs)
3689 { 3689 {
3690 _cb_tab_selector_show(tabs, tab_item); 3690 _cb_tab_selector_show(tabs, tab_item);
3691 return; 3691 return;
@@ -3784,7 +3784,7 @@ _tabs_set_title(Term_Container *tc, Term_Container *child,
3784 solo = (Solo*)tab_item->tc; 3784 solo = (Solo*)tab_item->tc;
3785 term = solo->term; 3785 term = solo->term;
3786 3786
3787 if (!term->config->notabs) 3787 if (term->config->show_tabs)
3788 { 3788 {
3789 edje_object_part_text_set(term->bg, "terminology.tab.title", 3789 edje_object_part_text_set(term->bg, "terminology.tab.title",
3790 title); 3790 title);
@@ -3854,7 +3854,7 @@ _tabs_refresh(Tabs *tabs)
3854 edje_object_part_text_set(term->bg, "terminology.tabmissed.label", bufmissed); 3854 edje_object_part_text_set(term->bg, "terminology.tabmissed.label", bufmissed);
3855 edje_object_signal_emit(term->bg, "tabcount,on", "terminology"); 3855 edje_object_signal_emit(term->bg, "tabcount,on", "terminology");
3856 // this is all below just for tab bar at the top 3856 // this is all below just for tab bar at the top
3857 if (!term->config->notabs) 3857 if (term->config->show_tabs)
3858 { 3858 {
3859 double v1, v2; 3859 double v1, v2;
3860 3860