[pitivi] mainwindow: Force calculating the toolbar height at the last minute



commit f90910b98896c29f6d0b16a9555047d7ed22dc6a
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Tue Jan 22 22:03:46 2013 -0500

    mainwindow: Force calculating the toolbar height at the last minute
    
    Somehow, on some monitors, the height being reported would change at runtime.

 pitivi/mainwindow.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index d0ab18f..efbe8dc 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -373,7 +373,7 @@ class PitiviMainWindow(Gtk.Window, Loggable):
         self.menu.show()
         self._main_toolbar_box.show_all()
         # Auto-hiding fullscreen toolbar
-        self._main_toolbar_height = self.toolbar.size_request().height
+        self._main_toolbar_height = self.toolbar.get_preferred_height()[1]
         self._fullscreen_toolbar_win = Gtk.Window(Gtk.WindowType.POPUP)
         self._fullscreen_toolbar_win.resize(self.get_screen().get_width(), self._main_toolbar_height)
         self._fullscreen_toolbar_win.set_transient_for(self)
@@ -496,6 +496,10 @@ class PitiviMainWindow(Gtk.Window, Loggable):
 
     def setFullScreen(self, fullscreen):
         """ Toggle the fullscreen mode of the application """
+        # For some bizarre reason, the toolbar's height is initially incorrect,
+        # we need to reset it after startup to ensure we have the proper values.
+        self._main_toolbar_height = self.toolbar.get_preferred_height()[1]
+
         if fullscreen:
             self.fullscreen()
             self.menu.hide()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]