From 16aac8d1f97facc3f0ecd618a94201d0a999faa7 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Sat, 8 Jan 2022 22:03:28 +0100 Subject: [PATCH] Fix collapsable pane --- src/main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.py b/src/main.py index 6ef65a8..13aa9a3 100644 --- a/src/main.py +++ b/src/main.py @@ -194,6 +194,15 @@ class Cast(wx.Frame): pane_sizer.Add(description, wx.GROW | wx.ALL, 2) pane_win.SetSizer(pane_sizer) pane_sizer.SetSizeHints(pane_win) + def fit_and_layout(_): + pane_sizer.Layout() + pane_sizer.Fit(pane_win) + inner_sizer.Layout() + inner_sizer.Fit(self) + self.m_sizer.Fit(self) + self.m_sizer.Layout() + + collapsable_pane.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED, lambda event: fit_and_layout(event) ) #inner_sizer.Add(description) self.m_sizer.Add(inner_sizer) self.m_sizer.AddSpacer(SPACER_HEIGHT)