about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTodd Fries <todd@fries.net>2011-01-12 18:41:56 +0000
committerTodd Fries <todd@fries.net>2011-01-12 18:41:56 +0000
commit1decddf2eadc22042958f463bfea06c59fbfcf1a (patch)
treef40f9bab994cc5708f393c8f570cb5dd245d0277
parenta8cbdb9eaf9b3206dd7a477186a0400aba46dcb6 (diff)
downloadxombrero-1decddf2eadc22042958f463bfea06c59fbfcf1a.tar.gz
implement :tab{s,show,h,hide}
-rw-r--r--xxxterm.c40
1 files changed, 32 insertions, 8 deletions
diff --git a/xxxterm.c b/xxxterm.c
index 957a628..2e0a113 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -345,6 +345,8 @@ struct karg {
 #define XT_TAB_DELQUIT		(3)
 #define XT_TAB_OPEN		(4)
 #define XT_TAB_UNDO_CLOSE	(5)
+#define XT_TAB_SHOW		(6)
+#define XT_TAB_HIDE		(7)
 
 #define XT_NAV_INVALID		(0)
 #define XT_NAV_BACK		(1)
@@ -2938,6 +2940,16 @@ move(struct tab *t, struct karg *args)
 	return (XT_CB_HANDLED);
 }
 
+void
+notebook_tab_set_visibility(GtkNotebook *notebook)
+{
+	if (showtabs == 0)
+		gtk_notebook_set_show_tabs(notebook, FALSE);
+	else {
+		gtk_notebook_set_show_tabs(notebook, TRUE);
+	}
+}
+
 int
 tabaction(struct tab *t, struct karg *args)
 {
@@ -2984,6 +2996,18 @@ tabaction(struct tab *t, struct karg *args)
 		if (newuri)
 			g_free(newuri);
 		break;
+	case XT_TAB_SHOW:
+		if (showtabs == 0) {
+			showtabs = 1;
+			notebook_tab_set_visibility(notebook);
+		}
+		break;
+	case XT_TAB_HIDE:
+		if (showtabs == 1) {
+			showtabs = 0;
+			notebook_tab_set_visibility(notebook);
+		}
+		break;
 	case XT_TAB_UNDO_CLOSE:
 		if (undo_count == 0) {
 			DNPRINTF(XT_D_TAB, "%s: no tabs to undo close", __func__);
@@ -3969,6 +3993,10 @@ struct cmd {
 	{ "tabe",		1,	tabaction,		{.i = XT_TAB_NEW} },
 	{ "tabclose",		0,	tabaction,		{.i = XT_TAB_DELETE} },
 	{ "tabc",		0,	tabaction,		{.i = XT_TAB_DELETE} },
+	{ "tabshow",		1,	tabaction,		{.i = XT_TAB_SHOW} },
+	{ "tabs",		1,	tabaction,		{.i = XT_TAB_SHOW} },
+	{ "tabhide",		1,	tabaction,		{.i = XT_TAB_HIDE} },
+	{ "tabh",		1,	tabaction,		{.i = XT_TAB_HIDE} },
 	{ "quit",		0,	tabaction,		{.i = XT_TAB_DELQUIT} },
 	{ "q",			0,	tabaction,		{.i = XT_TAB_DELQUIT} },
 	/* XXX add count to these commands */
@@ -5955,15 +5983,11 @@ create_canvas(void)
 	vbox = gtk_vbox_new(FALSE, 0);
 	gtk_box_set_spacing(GTK_BOX(vbox), 0);
 	notebook = GTK_NOTEBOOK(gtk_notebook_new());
-	if (showtabs == 0)
-		gtk_notebook_set_show_tabs(notebook, FALSE);
-	else {
-		gtk_notebook_set_tab_hborder(notebook, 0);
-		gtk_notebook_set_tab_vborder(notebook, 0);
-	}
-	gtk_notebook_set_show_border(notebook, FALSE);
+	gtk_notebook_set_tab_hborder(notebook, 0);
+	gtk_notebook_set_tab_vborder(notebook, 0);
 	gtk_notebook_set_scrollable(notebook, TRUE);
-	gtk_notebook_set_homogeneous_tabs(notebook, TRUE);
+	notebook_tab_set_visibility(notebook);
+	gtk_notebook_set_show_border(notebook, FALSE);
 	gtk_widget_set_can_focus(GTK_WIDGET(notebook), FALSE);
 
 	abtn = gtk_button_new();
9ab05da9f1e8e4b45293'>4c13e1f2 ^
f07bb12f ^







4c13e1f2 ^
f07bb12f ^
34a60763 ^
f07bb12f ^


4c13e1f2 ^
f07bb12f ^


4c13e1f2 ^

f07bb12f ^



4c13e1f2 ^
f07bb12f ^
4c13e1f2 ^


f07bb12f ^
34a60763 ^

4c13e1f2 ^
f07bb12f ^
4c13e1f2 ^
f07bb12f ^









34a60763 ^
f07bb12f ^


4c13e1f2 ^

f07bb12f ^


4c13e1f2 ^
34a60763 ^
f07bb12f ^
34a60763 ^
f07bb12f ^












f07bb12f ^















4c13e1f2 ^




34a60763 ^
4c13e1f2 ^
34a60763 ^
4c13e1f2 ^



f07bb12f ^
34a60763 ^
f07bb12f ^



























4c13e1f2 ^



f07bb12f ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212