From e5a249a4984fa625aab7b461debac85b517a51fa Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Thu, 19 Feb 2015 15:30:45 +0100 Subject: [PATCH] Fix titlebar label preventing scaling down titlebars by wrapping whole box in a viewport. --- terminatorlib/editablelabel.py | 2 +- terminatorlib/titlebar.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/terminatorlib/editablelabel.py b/terminatorlib/editablelabel.py index ef066fb2..7cdf7dd9 100644 --- a/terminatorlib/editablelabel.py +++ b/terminatorlib/editablelabel.py @@ -43,7 +43,7 @@ class EditableLabel(Gtk.EventBox): GObject.GObject.__init__(self) self._entry_handler_id = [] - self._label = Gtk.Label(label=text) + self._label = Gtk.Label(label=text, ellipsize='end') self._custom = False self.set_visible_window (False) self.add (self._label) diff --git a/terminatorlib/titlebar.py b/terminatorlib/titlebar.py index ef6d523f..6589ad7f 100755 --- a/terminatorlib/titlebar.py +++ b/terminatorlib/titlebar.py @@ -50,7 +50,7 @@ class Titlebar(Gtk.EventBox): self.label.connect('edit-done', self.on_edit_done) self.ebox = Gtk.EventBox() grouphbox = Gtk.HBox() - self.grouplabel = Gtk.Label() + self.grouplabel = Gtk.Label(ellipsize='end') self.groupicon = Gtk.Image() self.bellicon = Gtk.Image() self.bellicon.set_no_show_all(True) @@ -85,8 +85,10 @@ class Titlebar(Gtk.EventBox): hbox.pack_start(self.label, True, True, 0) hbox.pack_end(self.bellicon, False, False, 2) - self.add(hbox) - hbox.show_all() + viewport = Gtk.Viewport(hscroll_policy='natural') + viewport.add(hbox) + self.add (viewport) + viewport.show_all() self.set_no_show_all(True) self.show()