From 4fcc6e15b07b78f54d9783b6d940d12ec4640627 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 28 Jan 2018 16:35:10 +0100 Subject: [PATCH] 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 9aaa38c7c8f2c1cdd672e5b7fa757e591495c4cc, 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. --- samples/mediaplayer/mediaplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/mediaplayer/mediaplayer.cpp b/samples/mediaplayer/mediaplayer.cpp index bdcb095f81..6293bde936 100644 --- a/samples/mediaplayer/mediaplayer.cpp +++ b/samples/mediaplayer/mediaplayer.cpp @@ -1588,7 +1588,7 @@ wxMediaPlayerNotebookPage::wxMediaPlayerNotebookPage(wxMediaPlayerFrame* parentF wxASSERT_MSG(bOK, wxT("Could not create media control!")); wxUnusedVar(bOK); - sizer->Add(m_mediactrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5); + sizer->Add(m_mediactrl, wxSizerFlags().Expand().Border()); // // Create the playlist/listctrl