From e43369d3e6857a19ef1aadb3cc6c5c5230a9611c Mon Sep 17 00:00:00 2001 From: David Sowder Date: Sun, 27 Dec 2020 09:06:00 -0600 Subject: [PATCH] Re-factor Titlebar.update() to not duplicate the label text setting call --- terminatorlib/titlebar.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/terminatorlib/titlebar.py b/terminatorlib/titlebar.py index d6cd557a..8df29f3b 100644 --- a/terminatorlib/titlebar.py +++ b/terminatorlib/titlebar.py @@ -104,10 +104,11 @@ class Titlebar(Gtk.EventBox): def update(self, other=None): """Update our contents""" default_bg = False - if self.config['title_hide_sizetext']: - self.label.set_text("%s" % self.termtext) - else: - self.label.set_text("%s %s" % (self.termtext, self.sizetext)) + + temp_sizetext_str = '' + if not self.config['title_hide_sizetext']: + temp_sizetext_str = " %s" % (self.sizetext) + self.label.set_text("%s%s" % (self.termtext, temp_sizetext_str)) if (not self.config['title_use_system_font']) and self.config['title_font']: title_font = Pango.FontDescription(self.config['title_font'])