Move GTK3 wxNO_BORDER handling to wxControl

So wxNO_BORDER works with other controls, such as wxBitmapButton.
Also use GTK prefix on ApplyCssStyle(), and add an overload that
creates the GtkCssProvider.
This commit is contained in:
Paul Cornett
2017-11-15 10:51:38 -08:00
parent ef0309c141
commit 21620da3e5
5 changed files with 18 additions and 13 deletions

View File

@@ -32,7 +32,6 @@
#include <gtk/gtk.h>
#include "wx/gtk/private.h"
#include "wx/gtk/private/gtk2-compat.h"
#include "wx/gtk/private/object.h"
// ----------------------------------------------------------------------------
// helpers
@@ -728,18 +727,10 @@ bool wxTextCtrl::Create( wxWindow *parent,
// new, empty control, see https://trac.wxwidgets.org/ticket/11409
gtk_entry_get_text((GtkEntry*)m_text);
#ifndef __WXGTK3__
if (style & wxNO_BORDER)
{
#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<GtkCssProvider> 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);