From 02f49be9e2f58032a7c124ea77d7983834dc80b6 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 25 Apr 2014 19:13:44 -0400 Subject: [PATCH] serialcon: Hide scrollbar until there's something to scroll --- virtManager/serialcon.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/virtManager/serialcon.py b/virtManager/serialcon.py index f2e4452a..6662084d 100644 --- a/virtManager/serialcon.py +++ b/virtManager/serialcon.py @@ -376,6 +376,14 @@ class vmmSerialConsole(vmmGObject): self.box.append_page(self.error_label, Gtk.Label("")) self.box.show_all() + scrollbar.hide() + scrollbar.get_adjustment().connect( + "changed", self._scrollbar_adjustment_changed, scrollbar) + + def _scrollbar_adjustment_changed(self, adjustment, scrollbar): + scrollbar.set_visible( + adjustment.get_upper() > adjustment.get_page_size()) + def _cleanup(self): self.console.cleanup() self.console = None