Fix strange layout problems with the content sub panels (#2059).
[dcpomatic.git] / src / wx / content_sub_panel.cc
index e0a1a52bddac98382118852cc029b0c9c005c769..9c236abebfef4a1b552b5e8b5f084a283f569a1d 100644 (file)
@@ -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);
 }
+