diff --git a/docs/changes.txt b/docs/changes.txt index 886cb9c135..f3e82d2dce 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -167,6 +167,7 @@ All (GUI): wxGTK: - Make wxUIActionSimulator work with GTK+ 3 (Scott Talbert). +- Make wxBORDER_NONE work for wxTextCtrl with GTK+ 3 (Adrien Tétar). - Apply wxTextCtrl::SetDefaultStyle() to user-entered text (Andreas Falkenhahn). - Support background colour in wxDataViewCtrl attributes. - Improve wxSpinCtrl best size calculation. diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 2ca26fc029..56f5848901 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -32,6 +32,7 @@ #include #include "wx/gtk/private.h" #include "wx/gtk/private/gtk2-compat.h" +#include "wx/gtk/private/object.h" // ---------------------------------------------------------------------------- // helpers @@ -728,7 +729,17 @@ bool wxTextCtrl::Create( wxWindow *parent, gtk_entry_get_text((GtkEntry*)m_text); if (style & wxNO_BORDER) - g_object_set (m_text, "has-frame", FALSE, NULL); + { +#ifdef __WXGTK3__ + // this is sort of a workaround for when the builtin theme + // won't remove the frame by itself -- see + // https://bugzilla.gnome.org/show_bug.cgi?id=789732#c1 + wxGtkObject provider(gtk_css_provider_new()); + ApplyCssStyle(provider, "* { border: none; border-radius: 0; padding: 0 }"); +#else + gtk_entry_set_has_frame((GtkEntry*)m_text, FALSE); +#endif + } } g_object_ref(m_widget);