From a8c4cbee09197bdbf756de7989c84cba9a16a7fe Mon Sep 17 00:00:00 2001 From: oneeyeman1 Date: Fri, 26 Jul 2019 20:40:53 -0500 Subject: [PATCH] Fix new button appearance in already shown generic wxInfoBar If the info bar is already shown, newly added buttons have to be relaid out to appear correctly, so just add a call to Layout() in this case. This makes the generic version work as the native GTK one, which already handled this use case correctly. Closes https://github.com/wxWidgets/wxWidgets/pull/1441 Closes #14120. --- src/generic/infobar.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/generic/infobar.cpp b/src/generic/infobar.cpp index 9d270e9735..7da357176e 100644 --- a/src/generic/infobar.cpp +++ b/src/generic/infobar.cpp @@ -275,6 +275,8 @@ void wxInfoBarGeneric::AddButton(wxWindowID btnid, const wxString& label) #endif // __WXMAC__ sizer->Add(button, wxSizerFlags().Centre().DoubleBorder()); + if ( IsShown() ) + sizer->Layout(); } size_t wxInfoBarGeneric::GetButtonCount() const