make tab bar more configurable. Closes LP: #287307

This commit is contained in:
Chris Jones 2009-03-20 00:23:37 +00:00
parent 2ea44fb8bc
commit 4944ccabe7
3 changed files with 12 additions and 6 deletions

View File

@ -201,6 +201,10 @@ Default value: \fBFalse\fR
If set to True, the tab bar will be hidden. This means there will be no visual indication of either how many tabs there are, or which one you are on. Be warned that this can be very confusing and hard to use.
Default value: \fBFalse\fR
.TP
.B scroll_tabbar \fR(boolean)
If set to True, the tab bar will not fill the width of the window. The titlebars of the tabs will only take as much space as is necessary for the text they contain. Except, that is, if the tabs no longer fit the width of the window - in that case scroll buttons will appear to move through the tabs.
Default value: \fBFalse\fR
.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

View File

@ -108,6 +108,7 @@ Defaults = {
'enable_real_transparency' : False,
'try_posix_regexp' : platform.system() != 'Linux',
'hide_tabbar' : False,
'scroll_tabbar' : False,
'keybindings' : {
'zoom_in' : '<Ctrl>plus',
'zoom_out' : '<Ctrl>minus',

View File

@ -539,7 +539,7 @@ class Terminator:
parent.insert_page(pane, None, page)
notebooktablabel = TerminatorNotebookTabLabel(widget.get_window_title(), parent, self)
parent.set_tab_label(pane,notebooktablabel)
parent.set_tab_label_packing(pane, True, True, gtk.PACK_START)
parent.set_tab_label_packing(pane, not self.conf.scroll_tabbar, not self.conf.scroll_tabbar, gtk.PACK_START)
if self._tab_reorderable:
parent.set_tab_reorderable(pane, True)
parent.set_current_page(page)
@ -682,7 +682,8 @@ class Terminator:
if self._tab_reorderable:
notebook.connect('page-reordered',self.on_page_reordered)
notebook.set_tab_reorderable(widget, True)
notebook.set_property('homogeneous', True)
notebook.set_property('homogeneous', not self.conf.scroll_tabbar)
notebook.set_scrollable (self.conf.scroll_tabbar)
# Config validates this.
pos = getattr(gtk, "POS_%s" % self.conf.tab_position.upper())
notebook.set_tab_pos(pos)
@ -707,7 +708,7 @@ class Terminator:
notebooklabel = widget.get_window_title()
notebooktablabel = TerminatorNotebookTabLabel(notebooklabel, notebook, self)
notebook.set_tab_label(child, notebooktablabel)
notebook.set_tab_label_packing(child, True, True, gtk.PACK_START)
notebook.set_tab_label_packing(child, not self.conf.scroll_tabbar, not self.conf.scroll_tabbar, gtk.PACK_START)
wal = self.window.allocation
if not (self._maximised or self._fullscreen):
@ -732,7 +733,7 @@ class Terminator:
notebooklabel = terminal.get_window_title()
notebooktablabel = TerminatorNotebookTabLabel(notebooklabel, notebook, self)
notebook.set_tab_label(terminal, notebooktablabel)
notebook.set_tab_label_packing(terminal, True, True, gtk.PACK_START)
notebook.set_tab_label_packing(terminal, not self.conf.scroll_tabbar, not self.conf.scroll_tabbar, gtk.PACK_START)
if self._tab_reorderable:
notebook.set_tab_reorderable(terminal,True)
## Now, we set focus on the new term
@ -807,7 +808,7 @@ class Terminator:
grandparent.remove_page(page)
grandparent.insert_page(sibling, None,page)
grandparent.set_tab_label(sibling, TerminatorNotebookTabLabel("",grandparent, self))
grandparent.set_tab_label_packing(sibling, True, True, gtk.PACK_START)
grandparent.set_tab_label_packing(sibling, not self.conf.scroll_tabbar, not self.conf.scroll_tabbar, gtk.PACK_START)
if self._tab_reorderable:
grandparent.set_tab_reorderable(sibling, True)
grandparent.set_current_page(page)
@ -1375,7 +1376,7 @@ class Terminator:
if isinstance(self.old_parent, gtk.Notebook):
self.old_parent.insert_page(widget, None, self.old_page)
self.old_parent.set_tab_label(widget, TerminatorNotebookTabLabel("", self.old_parent, self))
self.old_parent.set_tab_label_packing(widget, True, True, gtk.PACK_START)
self.old_parent.set_tab_label_packing(widget, not self.conf.scroll_tabbar, not self.conf.scroll_tabbar, gtk.PACK_START)
if self._tab_reorderable:
self.old_parent.set_tab_reorderable(widget, True)
self.old_parent.set_current_page(self.old_page)