From 254ecec8108e4b0399e95e8d8145b397837e15a8 Mon Sep 17 00:00:00 2001 From: Thomas Hurst Date: Fri, 27 Jun 2008 18:54:42 +0100 Subject: [PATCH] Add close_button_on_tab option, defaulting to true. Set to false to turn off close buttons on tabs. --- doc/terminator_config.5 | 4 ++++ terminatorlib/config.py | 1 + terminatorlib/terminator.py | 13 +++++++------ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/doc/terminator_config.5 b/doc/terminator_config.5 index 595b7852..9314bbb3 100644 --- a/doc/terminator_config.5 +++ b/doc/terminator_config.5 @@ -133,6 +133,10 @@ Default value: \fBFalse\fR .B cycle_term_tab If this is set to true, when switching to the next/previous term, Terminator will cycle within the same tab. Ctrl-PageUp/PageDown can then be used to move from one tab to the other one. Default value: \fBTrue\fR +.TP +.B close_button_on_tab +If set to true, tabs will have a close button on them. +Default value: \fBTrue\fR .B copy_on_selection If set to True, text selections will be automatically copied to the clipboard, in addition to being made the Primary selection. Default value: \fBFalse\fR diff --git a/terminatorlib/config.py b/terminatorlib/config.py index ec983cf4..e61ab64b 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -126,6 +126,7 @@ class TerminatorConfValuestore: 'force_no_bell' : False, 'cycle_term_tab' : True, 'copy_on_selection' : False, + 'close_button_on_tab' : True, } def __getattr__ (self, keyname): diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index fc9d1fdc..f82143aa 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -39,13 +39,14 @@ class TerminatorNotebookTabLabel(gtk.HBox): icon = gtk.Image() icon.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_MENU) - self._button = gtk.Button() - self._button.set_relief(gtk.RELIEF_NONE) - self._button.set_image(icon) - self._button.connect('clicked', self.on_close) - self.pack_start(self._label, True, True) - self.pack_start(self._button, False, False) + + if terminator.conf.close_button_on_tab: + self._button = gtk.Button() + self._button.set_relief(gtk.RELIEF_NONE) + self._button.set_image(icon) + self._button.connect('clicked', self.on_close) + self.pack_start(self._button, False, False) self.show_all()