diff --git a/include/wx/gtk/toplevel.h b/include/wx/gtk/toplevel.h index 037a7498cb..19227ffa3f 100644 --- a/include/wx/gtk/toplevel.h +++ b/include/wx/gtk/toplevel.h @@ -74,6 +74,7 @@ public: virtual void SetLabel(const wxString& label) wxOVERRIDE { SetTitle( label ); } virtual wxString GetLabel() const wxOVERRIDE { return GetTitle(); } + virtual wxVisualAttributes GetDefaultAttributes() const wxOVERRIDE; virtual bool SetTransparent(wxByte alpha) wxOVERRIDE; virtual bool CanSetTransparent() wxOVERRIDE; diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index d7f94d8b3a..74c6ed2e1b 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -35,6 +35,7 @@ #include "wx/gtk/private.h" #include "wx/gtk/private/gtk3-compat.h" +#include "wx/gtk/private/stylecontext.h" #include "wx/gtk/private/win_gtk.h" #ifdef GDK_WINDOWING_X11 @@ -1815,3 +1816,12 @@ bool wxTopLevelWindowGTK::CanSetTransparent() "Composite", &opcode, &event, &error); #endif } + +wxVisualAttributes wxTopLevelWindowGTK::GetDefaultAttributes() const +{ + wxVisualAttributes attrs(GetClassDefaultAttributes()); +#ifdef __WXGTK3__ + wxGtkStyleContext().AddWindow().Bg(attrs.colBg); +#endif + return attrs; +}