diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 586714235c..5bcfba7110 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -2162,28 +2162,36 @@ public: #if defined(__WXGTK3__) GTKApplyCssStyle("*{ padding:0 }"); #else -#if !defined( __WXGTK127__ ) - GTKApplyWidgetStyle(true); // To enforce call to DoApplyWidgetStyle() -#endif + // Define a special button style without inner border + // if it's not yet done. + if ( !m_exactFitStyleDefined ) + { + gtk_rc_parse_string( + "style \"wxPGEditorBitmapButton_style\"\n" + "{ GtkButton::inner-border = { 0, 0, 0, 0 } }\n" + "widget \"*wxPGEditorBitmapButton*\" style \"wxPGEditorBitmapButton_style\"\n" + ); + m_exactFitStyleDefined = true; + } + + // Assign the button to the GTK style without inner border. + gtk_widget_set_name(m_widget, "wxPGEditorBitmapButton"); #endif } virtual ~wxPGEditorBitmapButton() { } -protected: - virtual void DoApplyWidgetStyle(GtkRcStyle *style) wxOVERRIDE - { - if ( style ) - { -#if !defined( __WXGTK127__ ) - style->xthickness = 0; - style->ythickness = 0; -#endif - } - wxBitmapButton::DoApplyWidgetStyle(style); - } +private: +#ifndef __WXGTK3__ + // To mark if special GTK style was already defined. + static bool m_exactFitStyleDefined; +#endif // !__WXGTK3__ }; +#ifndef __WXGTK3__ +bool wxPGEditorBitmapButton::m_exactFitStyleDefined = false; +#endif // !__WXGTK3__ + #else // !__WXGTK__ typedef wxBitmapButton wxPGEditorBitmapButton;