simplify title changes
This commit is contained in:
parent
f00c265f4c
commit
9f7834fb5b
|
@ -77,6 +77,8 @@ class Terminal(gtk.VBox):
|
||||||
|
|
||||||
self.titlebar = Titlebar()
|
self.titlebar = Titlebar()
|
||||||
self.titlebar.connect_icon(self.on_group_button_press)
|
self.titlebar.connect_icon(self.on_group_button_press)
|
||||||
|
self.connect('title-change', self.titlebar.set_terminal_title)
|
||||||
|
|
||||||
self.searchbar = Searchbar()
|
self.searchbar = Searchbar()
|
||||||
|
|
||||||
self.show()
|
self.show()
|
||||||
|
@ -259,18 +261,7 @@ class Terminal(gtk.VBox):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def on_vte_title_change(self, vte):
|
def on_vte_title_change(self, vte):
|
||||||
title = self.get_window_title()
|
self.emit('title-change', self.get_window_title())
|
||||||
if title == self.titlebar.oldtitle:
|
|
||||||
# Title hasn't changed, don't do anything
|
|
||||||
return
|
|
||||||
self.titlebar.oldtitle = title
|
|
||||||
|
|
||||||
if self.config['titletips']:
|
|
||||||
vte.set_property('has-tooltip', True)
|
|
||||||
vte.set_property('tooltip-text', title)
|
|
||||||
|
|
||||||
self.titlebar.set_terminal_title(title)
|
|
||||||
self.emit('title-change', title)
|
|
||||||
|
|
||||||
def on_vte_focus(self, vte):
|
def on_vte_focus(self, vte):
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -31,7 +31,7 @@ class Titlebar(gtk.EventBox):
|
||||||
"""Update the displayed terminal size"""
|
"""Update the displayed terminal size"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def set_terminal_title(self, title):
|
def set_terminal_title(self, widget, title):
|
||||||
"""Update the terminal title"""
|
"""Update the terminal title"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue