Use a scolled window in preference pages

This commit is contained in:
blitzmann
2018-02-19 23:32:44 -05:00
parent d59c897921
commit 8abd25fe40

View File

@@ -55,17 +55,17 @@ class PreferenceDialog(wx.Dialog):
self.Centre(wx.BOTH)
for prefView in PreferenceView.views:
page = wx.Panel(self.listbook)
page = wx.ScrolledWindow(self.listbook)
page.SetScrollbars(1, 1, 20, 20)
bmp = prefView.getImage()
if bmp:
imgID = self.imageList.Add(bmp)
else:
imgID = -1
prefView.populatePanel(page)
self.listbook.AddPage(page, prefView.title, imageId=imgID)
# 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 = 550
bestFit = self.GetBestVirtualSize()
if minHeight > bestFit[1]: