Use all available size for the video in mediaplayer sample

wxMediaCtrl doesn't compute its best size correctly until a video is
available and this resulted in using the best size of (0, 0) for it and
nothing being shown at all on the screen, even after starting to play a
video.

This is almost certainly a problem on its own, as there is some existing
code for updating the best size and redoing the layout of the parent
sizer when a new video is loaded, but for now just make the control
visible in the sample again by always expanding it to fill up all the
available size, as this is the smallest possible fix and this is how it
used to behave before, until 9aaa38c7c8,
which allowed to meaningfully use wxALIGN_CENTER_HORIZONTAL and wxEXPAND
together: until then, this didn't work at all, but the sample still used
wxALIGN_CENTER_HORIZONTAL by mistake, so just remove it now to restore
the original behaviour.

Closes #17917.
This commit is contained in:
Vadim Zeitlin 2018-01-28 16:35:10 +01:00
parent a184914242
commit 4fcc6e15b0

View File

@ -1588,7 +1588,7 @@ wxMediaPlayerNotebookPage::wxMediaPlayerNotebookPage(wxMediaPlayerFrame* parentF
wxASSERT_MSG(bOK, wxT("Could not create media control!")); wxASSERT_MSG(bOK, wxT("Could not create media control!"));
wxUnusedVar(bOK); wxUnusedVar(bOK);
sizer->Add(m_mediactrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5); sizer->Add(m_mediactrl, wxSizerFlags().Expand().Border());
// //
// Create the playlist/listctrl // Create the playlist/listctrl