From 35a0b0ce4b9b108cd6fd209b9af3b384e792de0b Mon Sep 17 00:00:00 2001 From: blitzmann Date: Mon, 3 Mar 2014 01:52:57 -0500 Subject: [PATCH] Fix for PreferenceDialog sizing issues --- gui/preferenceDialog.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gui/preferenceDialog.py b/gui/preferenceDialog.py index 15f0c2add..c3a1f9f1a 100644 --- a/gui/preferenceDialog.py +++ b/gui/preferenceDialog.py @@ -63,7 +63,15 @@ class PreferenceDialog(wx.Dialog): prefView.populatePanel(page) self.listbook.AddPage(page, prefView.title, imageId = imgID) - self.Fit() + # Set the height based on a condition. Can all the panels fit in the current height? + # If not, use the .GetBestVirtualSize() to ensure that all content is available. + minHeight = 360 + bestFit = self.GetBestVirtualSize() + if minHeight > bestFit[1]: + self.SetSizeWH(450, minHeight) + else: + self.SetSizeWH(450, bestFit[1]) + self.Layout() self.btnOK.Bind(wx.EVT_BUTTON, self.OnBtnOK)