Fixes:
* titlebars and titletips was not read properly from ~/.terminatorrc when a ~/.terminatorrc is a boolean, bool(value) has tobe used while comparing to True/False as value is read as a string * If titlebars=False, the label is still created but hidden, by doing so, one can show the title at anytime by right-clicking and enabling the title on a per term basis Added: * Terminator window title changes to: "Terminator: <active term title>"
This commit is contained in:
parent
031685268e
commit
92ce9fe4b3
22
terminator
22
terminator
|
@ -177,21 +177,19 @@ class TerminatorTerm:
|
||||||
self.reconfigure_vte ()
|
self.reconfigure_vte ()
|
||||||
self._vte.show ()
|
self._vte.show ()
|
||||||
|
|
||||||
#self._box = gtk.HBox ()
|
|
||||||
#self._box.show ()
|
|
||||||
|
|
||||||
self._termbox = gtk.HBox ()
|
self._termbox = gtk.HBox ()
|
||||||
self._termbox.show()
|
self._termbox.show()
|
||||||
|
|
||||||
if self.reconf('titlebars'):
|
|
||||||
self._title = gtk.Label()
|
self._title = gtk.Label()
|
||||||
self._title.show()
|
self._title.show()
|
||||||
self._box = gtk.VBox ()
|
self._box = gtk.VBox ()
|
||||||
self._box.show()
|
self._box.show()
|
||||||
self._box.pack_start(self._title, False)
|
self._box.pack_start(self._title, False)
|
||||||
self._box.pack_start(self._termbox)
|
self._box.pack_start(self._termbox)
|
||||||
|
|
||||||
|
if bool(self.reconf('titlebars')):
|
||||||
|
self._title.hide()
|
||||||
else:
|
else:
|
||||||
self._box = self._termbox
|
self._title.show()
|
||||||
|
|
||||||
self._scrollbar = gtk.VScrollbar (self._vte.get_adjustment ())
|
self._scrollbar = gtk.VScrollbar (self._vte.get_adjustment ())
|
||||||
if self.scrollbar_position != "hidden" and self.scrollbar_position != "disabled":
|
if self.scrollbar_position != "hidden" and self.scrollbar_position != "disabled":
|
||||||
|
@ -210,6 +208,7 @@ class TerminatorTerm:
|
||||||
self._vte.connect ("popup-menu", self.on_vte_popup_menu)
|
self._vte.connect ("popup-menu", self.on_vte_popup_menu)
|
||||||
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)
|
||||||
|
|
||||||
exit_action = self.gconf_client.get_string (self.profile + "/exit_action")
|
exit_action = self.gconf_client.get_string (self.profile + "/exit_action")
|
||||||
exit_action = self.reconf ("exit_action")
|
exit_action = self.reconf ("exit_action")
|
||||||
|
@ -595,15 +594,20 @@ class TerminatorTerm:
|
||||||
return menu
|
return menu
|
||||||
|
|
||||||
def on_vte_title_change(self, vte):
|
def on_vte_title_change(self, vte):
|
||||||
if self.reconf ('titletips'):
|
if bool(self.reconf ('titletips')):
|
||||||
vte.set_property ("has-tooltip", True)
|
vte.set_property ("has-tooltip", True)
|
||||||
vte.set_property ("tooltip-text", vte.get_window_title ())
|
vte.set_property ("tooltip-text", vte.get_window_title ())
|
||||||
if self.reconf ('titlebars'):
|
#set the title anyhow, titlebars setting only show/hide the label
|
||||||
self._title.set_text(vte.get_window_title ())
|
self._title.set_text(vte.get_window_title ())
|
||||||
|
self.terminator.set_window_title("Terminator: %s" %vte.get_window_title ())
|
||||||
|
|
||||||
def get_box (self):
|
def get_box (self):
|
||||||
return self._box
|
return self._box
|
||||||
|
|
||||||
|
def on_vte_focus(self, vte):
|
||||||
|
if vte.get_window_title ():
|
||||||
|
self.terminator.set_window_title("Terminator: %s" %vte.get_window_title ())
|
||||||
|
|
||||||
class Terminator:
|
class Terminator:
|
||||||
def __init__ (self, profile, command = None, fullscreen = False, maximise = False, borderless = False):
|
def __init__ (self, profile, command = None, fullscreen = False, maximise = False, borderless = False):
|
||||||
self.profile = profile
|
self.profile = profile
|
||||||
|
@ -724,6 +728,8 @@ class Terminator:
|
||||||
if not self.on_delete_event (window, gtk.gdk.Event (gtk.gdk.DELETE)):
|
if not self.on_delete_event (window, gtk.gdk.Event (gtk.gdk.DELETE)):
|
||||||
self.on_destroy_event (window, gtk.gdk.Event (gtk.gdk.DESTROY))
|
self.on_destroy_event (window, gtk.gdk.Event (gtk.gdk.DESTROY))
|
||||||
|
|
||||||
|
def set_window_title(self, title):
|
||||||
|
self.window.set_title(title)
|
||||||
|
|
||||||
def splitaxis (self, widget, vertical=True):
|
def splitaxis (self, widget, vertical=True):
|
||||||
""" Split the provided widget on the horizontal or vertical axis. """
|
""" Split the provided widget on the horizontal or vertical axis. """
|
||||||
|
|
Loading…
Reference in New Issue