From 18c5a774469d592715a378064538e6bd4e0db422 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Thu, 9 Jan 2014 17:26:03 -0800 Subject: [PATCH] widgets.main: set position label to a fixed size Changing the position label text will cause the layout to invalidate and the widget ends up getting resized, which is annoying. Use a fixed size to prevent this from happening. Signed-off-by: David Aguilar --- cola/widgets/main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cola/widgets/main.py b/cola/widgets/main.py index 31b0ac48..243ca9e3 100644 --- a/cola/widgets/main.py +++ b/cola/widgets/main.py @@ -107,6 +107,13 @@ class MainView(MainWindow): font = qtutils.default_monospace_font() font.setPointSize(int(font.pointSize() * 0.8)) self.position_label.setFont(font) + + # make the position label fixed size to avoid layout issues + fm = self.position_label.fontMetrics() + width = fm.width('999:999') + height = self.position_label.sizeHint().height() + self.position_label.setFixedSize(width, height) + self.commitdockwidget = create_dock(N_('Commit'), self) titlebar = self.commitdockwidget.titleBarWidget() titlebar.add_corner_widget(self.position_label) -- 2.11.4.GIT