From 845ca998c015064a6a269ac9b62db0cb0fa545a0 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sun, 21 Aug 2011 01:07:11 +0100 Subject: [PATCH] =?UTF-8?q?Add=20config=20option=20to=20hide=20terminal=20?= =?UTF-8?q?size.=20Patch=20from=20Jo=C3=A3o=20Pinto.=20Fixes=20LP#691213?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- terminatorlib/config.py | 1 + terminatorlib/preferences.glade | 33 ++++++++++++++++++++++++++++++++- terminatorlib/prefseditor.py | 8 ++++++++ terminatorlib/titlebar.py | 5 ++++- 4 files changed, 45 insertions(+), 2 deletions(-) diff --git a/terminatorlib/config.py b/terminatorlib/config.py index 0b7a616b..47b6973e 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -91,6 +91,7 @@ DEFAULTS = { 'hide_on_lose_focus' : False, 'sticky' : False, 'try_posix_regexp' : platform.system() != 'Linux', + 'title_hide_sizetext' : False, 'title_transmit_fg_color' : '#ffffff', 'title_transmit_bg_color' : '#c80003', 'title_receive_fg_color' : '#ffffff', diff --git a/terminatorlib/preferences.glade b/terminatorlib/preferences.glade index 10867b5a..e1b4b40a 100644 --- a/terminatorlib/preferences.glade +++ b/terminatorlib/preferences.glade @@ -298,7 +298,7 @@ True - 11 + 12 2 6 @@ -637,6 +637,37 @@ GTK_EXPAND + + + True + 0.50999999046325684 + Hide size from title + + + 11 + 12 + + + + + + + True + True + False + True + True + + + + 1 + 2 + 11 + 12 + + GTK_EXPAND + + 0 diff --git a/terminatorlib/prefseditor.py b/terminatorlib/prefseditor.py index de895149..3d401e3b 100755 --- a/terminatorlib/prefseditor.py +++ b/terminatorlib/prefseditor.py @@ -230,6 +230,9 @@ class PrefsEditor: #Show on all workspaces widget = guiget('stickycheck') widget.set_active(self.config['sticky']) + #Hide size text from the title bar + widget = guiget('title_hide_sizetextcheck') + widget.set_active(self.config['title_hide_sizetext']) ## Profile tab # Populate the profile list @@ -583,6 +586,11 @@ class PrefsEditor: self.config['sticky'] = widget.get_active() self.config.save() + def on_title_hide_sizetextcheck_toggled(self, widget): + """Window geometry setting changed""" + self.config['title_hide_sizetext'] = widget.get_active() + self.config.save() + def on_allow_bold_checkbutton_toggled(self, widget): """Allow bold setting changed""" self.config['allow_bold'] = widget.get_active() diff --git a/terminatorlib/titlebar.py b/terminatorlib/titlebar.py index eca8e8a0..7f2e23fb 100755 --- a/terminatorlib/titlebar.py +++ b/terminatorlib/titlebar.py @@ -98,7 +98,10 @@ class Titlebar(gtk.EventBox): def update(self, other=None): """Update our contents""" default_bg = False - self.label.set_text("%s %s" % (self.termtext, self.sizetext)) + if self.config['title_hide_sizetext']: + self.label.set_text("%s" % self.termtext) + else: + self.label.set_text("%s %s" % (self.termtext, self.sizetext)) if other: term = self.terminal