summaryrefslogtreecommitdiff
path: root/src/wx/content_sub_panel.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-07-09 00:30:02 +0200
committerCarl Hetherington <cth@carlh.net>2021-07-09 00:30:02 +0200
commit8ccbe70f3c2f5db9e88978a98f3ad5735ece07ab (patch)
tree13afe8aefd398bff1d87ff09f729ef7bdee05b60 /src/wx/content_sub_panel.cc
parentcf7b5fd94e50f740ab93f52343610d01c80ac6d5 (diff)
Fix strange layout problems with the content sub panels (#2059).
It seems that if Layout() is called on a sizer inside a wxScrolledWindow when that window is scrolled, things go wrong. Work around this by wrapping calls to Layout().
Diffstat (limited to 'src/wx/content_sub_panel.cc')
-rw-r--r--src/wx/content_sub_panel.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/wx/content_sub_panel.cc b/src/wx/content_sub_panel.cc
index e0a1a52bd..9c236abeb 100644
--- a/src/wx/content_sub_panel.cc
+++ b/src/wx/content_sub_panel.cc
@@ -47,7 +47,7 @@ ContentSubPanel::ContentSubPanel (ContentPanel* p, wxString name)
}
void
-ContentSubPanel::setup_refer_button (wxCheckBox* button, wxStaticText* note, shared_ptr<DCPContent> dcp, bool can_reference, wxString cannot) const
+ContentSubPanel::setup_refer_button (wxCheckBox* button, wxStaticText* note, shared_ptr<DCPContent> dcp, bool can_reference, wxString cannot)
{
button->Enable (can_reference);
@@ -65,5 +65,18 @@ ContentSubPanel::setup_refer_button (wxCheckBox* button, wxStaticText* note, sha
note->Show ();
}
+ layout ();
+}
+
+
+void
+ContentSubPanel::layout ()
+{
+ int x;
+ int y;
+ GetViewStart (&x, &y);
+ Scroll (0, 0);
_sizer->Layout ();
+ Scroll (x, y);
}
+