diff --git a/src/gtk/checkbox.cpp b/src/gtk/checkbox.cpp index d33908be4d..0579417ebc 100644 --- a/src/gtk/checkbox.cpp +++ b/src/gtk/checkbox.cpp @@ -156,8 +156,22 @@ bool wxCheckBox::Create(wxWindow *parent, m_parent->DoAddChild( this ); +#ifdef __WXGTK3__ + // CSS added if the window has wxNO_BORDER inside base class PostCreation() + // makes checkbox look broken in the default GTK 3 theme, so avoid doing + // this by temporarily turning this flag off. + if ( style & wxNO_BORDER ) + ToggleWindowStyle(wxNO_BORDER); +#endif + PostCreation(size); +#ifdef __WXGTK3__ + // Turn it back on if necessary. + if ( style & wxNO_BORDER ) + ToggleWindowStyle(wxNO_BORDER); +#endif + return true; }