Add support for tab_position.

This commit is contained in:
Thomas Hurst 2008-08-28 17:08:15 +01:00
parent 6016f06775
commit 3c77ec10c1
3 changed files with 23 additions and 6 deletions

View File

@ -182,14 +182,18 @@ Default value: \fBTrue\fR
If set to True, tabs will have a close button on them. If set to True, tabs will have a close button on them.
Default value: \fBTrue\fR Default value: \fBTrue\fR
.TP .TP
.B copy_on_selection \fR(boolean) .B tab_position
If set to True, text selections will be automatically copied to the clipboard, in addition to being made the Primary selection. Defines where tabs are placed. Can be any of: top, left, right, bottom.
Default value: \fBFalse\fR Default value: \fBtop\fR
.TP .TP
.B extreme_tabs \fB(boolean)\fR .B extreme_tabs \fB(boolean)\fR
If set to True, tabs can be created within other tabs. Be warned that this can be very confusing and hard to use. If set to True, tabs can be created within other tabs. Be warned that this can be very confusing and hard to use.
Default value: \fBFalse\fR Default value: \fBFalse\fR
.TP .TP
.B copy_on_selection \fR(boolean)
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
.TP
.B try_posix_regexp \fB(boolean)\fR .B try_posix_regexp \fB(boolean)\fR
If set to True, URL matching regexps will try to use POSIX style first, and fall back on GNU style on failure. If you are on Linux but URL matches don't work, try setting this to True. If you are not on Linux, but you get VTE warnings on startup saying "Error compiling regular expression", set this to False to silence them (they are otherwise harmless). If set to True, URL matching regexps will try to use POSIX style first, and fall back on GNU style on failure. If you are on Linux but URL matches don't work, try setting this to True. If you are not on Linux, but you get VTE warnings on startup saying "Error compiling regular expression", set this to False to silence them (they are otherwise harmless).
Default value: \fBFalse\fR on Linux, \fBTrue\fR otherwise. Default value: \fBFalse\fR on Linux, \fBTrue\fR otherwise.

View File

@ -98,6 +98,7 @@ Defaults = {
'cycle_term_tab' : True, 'cycle_term_tab' : True,
'copy_on_selection' : False, 'copy_on_selection' : False,
'close_button_on_tab' : True, 'close_button_on_tab' : True,
'tab_position' : 'top',
'enable_real_transparency' : False, 'enable_real_transparency' : False,
'try_posix_regexp' : platform.system() != 'Linux', 'try_posix_regexp' : platform.system() != 'Linux',
'keybindings' : { 'keybindings' : {
@ -269,6 +270,11 @@ Errors were encountered while parsing terminator_config(5) file:
self.values[key] = value self.values[key] = value
except ValueError: except ValueError:
raise ValueError(_("Setting %s value %s not a valid colour; ignoring") % (key,repr(value))) raise ValueError(_("Setting %s value %s not a valid colour; ignoring") % (key,repr(value)))
elif key == 'tab_position':
if value.lower() in ('top', 'left', 'bottom', 'right'):
self.values[key] = value.lower()
else:
raise ValueError(_("%s must be one of: top, left, right, bottom") % key)
elif deftype == 'bool': elif deftype == 'bool':
if value.lower () in ('true', 'yes', 'on'): if value.lower () in ('true', 'yes', 'on'):
self.values[key] = True self.values[key] = True

View File

@ -34,7 +34,12 @@ class TerminatorNotebookTabLabel(gtk.HBox):
gtk.HBox.__init__(self, False) gtk.HBox.__init__(self, False)
self._notebook = notebook self._notebook = notebook
self.terminator = terminator self.terminator = terminator
self._label = gtk.Label(title) self._label = gtk.Label(title)
tab_pos = notebook.get_tab_pos()
if tab_pos == gtk.POS_LEFT:
self._label.set_angle(90)
elif tab_pos == gtk.POS_RIGHT:
self._label.set_angle(270)
icon = gtk.Image() icon = gtk.Image()
icon.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_MENU) icon.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_MENU)
self.pack_start(self._label, True, True) self.pack_start(self._label, True, True)
@ -344,7 +349,7 @@ class Terminator:
parent.set_tab_label_packing(pane, True, True, gtk.PACK_START) parent.set_tab_label_packing(pane, True, True, gtk.PACK_START)
parent.set_tab_reorderable(pane, True) parent.set_tab_reorderable(pane, True)
parent.set_current_page(page) parent.set_current_page(page)
position = (vertical) and parent.allocation.height \ position = (vertical) and parent.allocation.height \
or parent.allocation.width or parent.allocation.width
@ -480,10 +485,12 @@ class Terminator:
((self.conf.extreme_tabs and not toplevel) or not isinstance(child, gtk.Notebook))): ((self.conf.extreme_tabs and not toplevel) or not isinstance(child, gtk.Notebook))):
#no notebook yet. #no notebook yet.
notebook = gtk.Notebook() notebook = gtk.Notebook()
#notebook.set_tab_pos(gtk.POS_TOP)
notebook.connect('page-reordered',self.on_page_reordered) notebook.connect('page-reordered',self.on_page_reordered)
notebook.set_property('homogeneous', True) notebook.set_property('homogeneous', True)
notebook.set_tab_reorderable(widget, True) notebook.set_tab_reorderable(widget, True)
# Config validates this.
pos = getattr(gtk, "POS_%s" % self.conf.tab_position.upper())
notebook.set_tab_pos(pos)
if isinstance(parent, gtk.Paned): if isinstance(parent, gtk.Paned):
if parent.get_child1() == child: if parent.get_child1() == child: