Fix sizing of editor's reel dialog.
authorCarl Hetherington <cth@carlh.net>
Sat, 3 Jun 2023 19:14:46 +0000 (21:14 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 4 Jun 2023 22:48:55 +0000 (00:48 +0200)
src/tools/dcpomatic_editor.cc

index a61a17ce4ff74eb8cd80680b07c7392cdac43937..69fbe4643a1fa2dec5be43f748685fa0c472a8d2 100644 (file)
@@ -147,10 +147,10 @@ public:
        ReelEditor(wxWindow* parent)
                : wxDialog(parent, wxID_ANY, _("Edit reel"))
        {
-               auto sizer = new wxBoxSizer(wxVERTICAL);
+               _sizer = new wxBoxSizer(wxVERTICAL);
                _notebook = new wxNotebook(this, wxID_ANY);
-               sizer->Add(_notebook, wxEXPAND | wxALL, 1, DCPOMATIC_DIALOG_BORDER);
-               SetSizerAndFit(sizer);
+               _sizer->Add(_notebook, wxEXPAND | wxALL, 1, DCPOMATIC_DIALOG_BORDER);
+               SetSizerAndFit(_sizer);
        }
 
        optional<shared_ptr<dcp::Reel>> get() {
@@ -171,10 +171,14 @@ public:
                if (_reel->main_subtitle()) {
                        _notebook->AddPage(new AssetPanel(_notebook, _reel->main_subtitle()), _("Subtitle"));
                }
+
+               _sizer->Layout();
+               _sizer->SetSizeHints(this);
        }
 
 private:
        wxNotebook* _notebook = nullptr;
+       wxSizer* _sizer = nullptr;
        shared_ptr<dcp::Reel> _reel;
 };