Remove ad-hoc titlebar visibility control and make the preferences setting be applied by Terminal::reconfigure()

This commit is contained in:
Chris Jones 2010-02-09 13:08:07 +00:00
parent 79a340539b
commit 5520fe11c8
3 changed files with 8 additions and 10 deletions

View File

@ -658,6 +658,10 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
self.config['alternate_screen_scroll']) self.config['alternate_screen_scroll'])
self.titlebar.update() self.titlebar.update()
if self.config['show_titlebar'] == True:
self.titlebar.show()
else:
self.titlebar.hide()
self.vte.queue_draw() self.vte.queue_draw()
def get_window_title(self): def get_window_title(self):
@ -742,10 +746,6 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
"""Show or hide the terminal scrollbar""" """Show or hide the terminal scrollbar"""
self.toggle_widget_visibility(self.scrollbar) self.toggle_widget_visibility(self.scrollbar)
def do_titlebar_toggle(self):
"""Show or hide the terminal titlebar"""
self.toggle_widget_visibility(self.titlebar)
def toggle_widget_visibility(self, widget): def toggle_widget_visibility(self, widget):
"""Show or hide a widget""" """Show or hide a widget"""
if widget.get_property('visible'): if widget.get_property('visible'):

View File

@ -128,11 +128,6 @@ class TerminalPopupMenu(object):
item.connect('toggled', lambda x: terminal.do_scrollbar_toggle()) item.connect('toggled', lambda x: terminal.do_scrollbar_toggle())
menu.append(item) menu.append(item)
item = gtk.CheckMenuItem(_('Show _titlebar'))
item.set_active(terminal.titlebar.get_property('visible'))
item.connect('toggled', lambda x: terminal.do_titlebar_toggle())
menu.append(item)
item = gtk.MenuItem(_('_Preferences')) item = gtk.MenuItem(_('_Preferences'))
item.connect('activate', lambda x: PrefsEditor(self.terminal)) item.connect('activate', lambda x: PrefsEditor(self.terminal))
menu.append(item) menu.append(item)

View File

@ -80,7 +80,10 @@ class Titlebar(gtk.EventBox):
hbox.pack_start(self.label, True, True) hbox.pack_start(self.label, True, True)
self.add(hbox) self.add(hbox)
self.show_all() hbox.show_all()
self.set_no_show_all(True)
if self.config['show_titlebar'] == True:
self.show()
self.connect('button-press-event', self.on_clicked) self.connect('button-press-event', self.on_clicked)