From 5520fe11c84eff7ad485a350fc5fc0e90d1fadfc Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 9 Feb 2010 13:08:07 +0000 Subject: [PATCH] Remove ad-hoc titlebar visibility control and make the preferences setting be applied by Terminal::reconfigure() --- terminatorlib/terminal.py | 8 ++++---- terminatorlib/terminal_popup_menu.py | 5 ----- terminatorlib/titlebar.py | 5 ++++- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 63e0971e..01cbd7e4 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -658,6 +658,10 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) self.config['alternate_screen_scroll']) self.titlebar.update() + if self.config['show_titlebar'] == True: + self.titlebar.show() + else: + self.titlebar.hide() self.vte.queue_draw() def get_window_title(self): @@ -742,10 +746,6 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) """Show or hide the terminal 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): """Show or hide a widget""" if widget.get_property('visible'): diff --git a/terminatorlib/terminal_popup_menu.py b/terminatorlib/terminal_popup_menu.py index c2af5ef9..370095b9 100755 --- a/terminatorlib/terminal_popup_menu.py +++ b/terminatorlib/terminal_popup_menu.py @@ -128,11 +128,6 @@ class TerminalPopupMenu(object): item.connect('toggled', lambda x: terminal.do_scrollbar_toggle()) 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.connect('activate', lambda x: PrefsEditor(self.terminal)) menu.append(item) diff --git a/terminatorlib/titlebar.py b/terminatorlib/titlebar.py index 6b47ceb8..a0a43cb6 100755 --- a/terminatorlib/titlebar.py +++ b/terminatorlib/titlebar.py @@ -80,7 +80,10 @@ class Titlebar(gtk.EventBox): hbox.pack_start(self.label, True, True) 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)