Fix to LP#252971 making terminator compatible fix Dapper
This commit is contained in:
parent
e6497992e8
commit
bbc17502a8
|
@ -54,7 +54,7 @@ class TerminatorNotebookTabLabel(gtk.HBox):
|
||||||
self._button.connect('clicked', self.on_close)
|
self._button.connect('clicked', self.on_close)
|
||||||
self._button.set_name("terminator-tab-close-button")
|
self._button.set_name("terminator-tab-close-button")
|
||||||
self.connect("style-set", self.on_style_set)
|
self.connect("style-set", self.on_style_set)
|
||||||
|
if hasattr(self._button, "set_tooltip_text"):
|
||||||
self._button.set_tooltip_text(_("Close Tab"))
|
self._button.set_tooltip_text(_("Close Tab"))
|
||||||
self.pack_start(self._button, False, False)
|
self.pack_start(self._button, False, False)
|
||||||
self.show_all()
|
self.show_all()
|
||||||
|
@ -107,6 +107,10 @@ class Terminator:
|
||||||
stores = []
|
stores = []
|
||||||
stores.append (config.TerminatorConfValuestoreRC ())
|
stores.append (config.TerminatorConfValuestoreRC ())
|
||||||
|
|
||||||
|
self._tab_reorderable = True
|
||||||
|
if not hasattr(gtk.Notebook, "set_tab_reorderable") or not hasattr(gtk.Notebook, "get_tab_reorderable"):
|
||||||
|
self._tab_reorderable = False
|
||||||
|
|
||||||
if not no_gconf:
|
if not no_gconf:
|
||||||
try:
|
try:
|
||||||
import gconf
|
import gconf
|
||||||
|
@ -435,6 +439,7 @@ class Terminator:
|
||||||
notebooktablabel = TerminatorNotebookTabLabel(widget.get_window_title(), parent, self)
|
notebooktablabel = TerminatorNotebookTabLabel(widget.get_window_title(), parent, self)
|
||||||
parent.set_tab_label(pane,notebooktablabel)
|
parent.set_tab_label(pane,notebooktablabel)
|
||||||
parent.set_tab_label_packing(pane, True, True, gtk.PACK_START)
|
parent.set_tab_label_packing(pane, True, True, gtk.PACK_START)
|
||||||
|
if self._tab_reorderable:
|
||||||
parent.set_tab_reorderable(pane, True)
|
parent.set_tab_reorderable(pane, True)
|
||||||
parent.set_current_page(page)
|
parent.set_current_page(page)
|
||||||
|
|
||||||
|
@ -573,9 +578,10 @@ 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()
|
||||||
|
if self._tab_reorderable:
|
||||||
notebook.connect('page-reordered',self.on_page_reordered)
|
notebook.connect('page-reordered',self.on_page_reordered)
|
||||||
notebook.set_property('homogeneous', True)
|
|
||||||
notebook.set_tab_reorderable(widget, True)
|
notebook.set_tab_reorderable(widget, True)
|
||||||
|
notebook.set_property('homogeneous', True)
|
||||||
# Config validates this.
|
# Config validates this.
|
||||||
pos = getattr(gtk, "POS_%s" % self.conf.tab_position.upper())
|
pos = getattr(gtk, "POS_%s" % self.conf.tab_position.upper())
|
||||||
notebook.set_tab_pos(pos)
|
notebook.set_tab_pos(pos)
|
||||||
|
@ -590,6 +596,7 @@ class Terminator:
|
||||||
elif isinstance(parent, gtk.Window):
|
elif isinstance(parent, gtk.Window):
|
||||||
child.reparent(notebook)
|
child.reparent(notebook)
|
||||||
parent.add(notebook)
|
parent.add(notebook)
|
||||||
|
if self._tab_reorderable:
|
||||||
notebook.set_tab_reorderable(child,True)
|
notebook.set_tab_reorderable(child,True)
|
||||||
notebooklabel = ""
|
notebooklabel = ""
|
||||||
if isinstance(child, TerminatorTerm):
|
if isinstance(child, TerminatorTerm):
|
||||||
|
@ -624,6 +631,7 @@ class Terminator:
|
||||||
notebooktablabel = TerminatorNotebookTabLabel(notebooklabel, notebook, self)
|
notebooktablabel = TerminatorNotebookTabLabel(notebooklabel, notebook, self)
|
||||||
notebook.set_tab_label(terminal, notebooktablabel)
|
notebook.set_tab_label(terminal, notebooktablabel)
|
||||||
notebook.set_tab_label_packing(terminal, True, True, gtk.PACK_START)
|
notebook.set_tab_label_packing(terminal, True, True, gtk.PACK_START)
|
||||||
|
if self._tab_reorderable:
|
||||||
notebook.set_tab_reorderable(terminal,True)
|
notebook.set_tab_reorderable(terminal,True)
|
||||||
## Now, we set focus on the new term
|
## Now, we set focus on the new term
|
||||||
notebook.set_current_page(-1)
|
notebook.set_current_page(-1)
|
||||||
|
@ -698,6 +706,7 @@ class Terminator:
|
||||||
grandparent.insert_page(sibling, None,page)
|
grandparent.insert_page(sibling, None,page)
|
||||||
grandparent.set_tab_label(sibling, TerminatorNotebookTabLabel("",grandparent, self))
|
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, True, True, gtk.PACK_START)
|
||||||
|
if self._tab_reorderable:
|
||||||
grandparent.set_tab_reorderable(sibling, True)
|
grandparent.set_tab_reorderable(sibling, True)
|
||||||
grandparent.set_current_page(page)
|
grandparent.set_current_page(page)
|
||||||
else:
|
else:
|
||||||
|
@ -1010,6 +1019,7 @@ class Terminator:
|
||||||
self.old_parent.insert_page(widget, None, self.old_page)
|
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(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, True, True, gtk.PACK_START)
|
||||||
|
if self._tab_reorderable:
|
||||||
self.old_parent.set_tab_reorderable(widget, True)
|
self.old_parent.set_tab_reorderable(widget, True)
|
||||||
self.old_parent.set_current_page(self.old_page)
|
self.old_parent.set_current_page(self.old_page)
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,10 @@ class TerminatorTerm (gtk.VBox):
|
||||||
self.clipboard = gtk.clipboard_get (gtk.gdk.SELECTION_CLIPBOARD)
|
self.clipboard = gtk.clipboard_get (gtk.gdk.SELECTION_CLIPBOARD)
|
||||||
self.scrollbar_position = self.conf.scrollbar_position
|
self.scrollbar_position = self.conf.scrollbar_position
|
||||||
|
|
||||||
|
self._composited_support = True
|
||||||
self._vte = vte.Terminal ()
|
self._vte = vte.Terminal ()
|
||||||
|
if not hasattr(self._vte, "set_opacity") or not hasattr(self._vte, "is_composited"):
|
||||||
|
self._composited_support = False
|
||||||
#self._vte.set_double_buffered(True)
|
#self._vte.set_double_buffered(True)
|
||||||
self._vte.set_size (80, 24)
|
self._vte.set_size (80, 24)
|
||||||
self.reconfigure_vte ()
|
self.reconfigure_vte ()
|
||||||
|
@ -134,7 +137,7 @@ class TerminatorTerm (gtk.VBox):
|
||||||
|
|
||||||
if self.conf.copy_on_selection:
|
if self.conf.copy_on_selection:
|
||||||
self._vte.connect ("selection-changed", lambda widget: self._vte.copy_clipboard ())
|
self._vte.connect ("selection-changed", lambda widget: self._vte.copy_clipboard ())
|
||||||
|
if self._composited_support :
|
||||||
self._vte.connect ("composited-changed", self.on_composited_changed)
|
self._vte.connect ("composited-changed", self.on_composited_changed)
|
||||||
self._vte.connect ("window-title-changed", self.on_vte_title_change)
|
self._vte.connect ("window-title-changed", self.on_vte_title_change)
|
||||||
self._vte.connect ("grab-focus", self.on_vte_focus)
|
self._vte.connect ("grab-focus", self.on_vte_focus)
|
||||||
|
@ -545,15 +548,18 @@ text/plain
|
||||||
self._vte.set_scroll_background(False)
|
self._vte.set_scroll_background(False)
|
||||||
|
|
||||||
# set transparency for the background (image)
|
# set transparency for the background (image)
|
||||||
|
opacity = 65535
|
||||||
if background_type in ("image", "transparent"):
|
if background_type in ("image", "transparent"):
|
||||||
self._vte.set_background_tint_color (bg_color)
|
self._vte.set_background_tint_color (bg_color)
|
||||||
self._vte.set_background_saturation(1 - (self.conf.background_darkness))
|
self._vte.set_background_saturation(1 - (self.conf.background_darkness))
|
||||||
self._vte.set_opacity(int(self.conf.background_darkness * 65535))
|
opacity = int(self.conf.background_darkness * 65535)
|
||||||
else:
|
else:
|
||||||
self._vte.set_background_saturation(1)
|
self._vte.set_background_saturation(1)
|
||||||
self._vte.set_opacity(65535)
|
|
||||||
|
|
||||||
if not self._vte.is_composited():
|
if self._composited_support:
|
||||||
|
self._vte.set_opacity(opacity)
|
||||||
|
|
||||||
|
if self._composited_support and not self._vte.is_composited():
|
||||||
self._vte.set_background_transparent (background_type == "transparent")
|
self._vte.set_background_transparent (background_type == "transparent")
|
||||||
else:
|
else:
|
||||||
self._vte.set_background_transparent (False)
|
self._vte.set_background_transparent (False)
|
||||||
|
|
Loading…
Reference in New Issue