Fix wxStaticBox non-default background with GTK+2

See #15466
This commit is contained in:
Paul Cornett 2017-12-20 22:29:21 -08:00
parent c23cac4c79
commit 121ac8742d

View File

@ -44,6 +44,14 @@ static void size_allocate(GtkWidget* widget, GtkAllocation* alloc, void*)
gtk_widget_size_allocate(label_widget, &a);
}
}
static gboolean expose_event(GtkWidget* widget, GdkEventExpose*, wxWindow*)
{
const GtkAllocation& a = widget->allocation;
gtk_paint_flat_box(gtk_widget_get_style(widget), gtk_widget_get_window(widget),
GTK_STATE_NORMAL, GTK_SHADOW_NONE, NULL, widget, "", a.x, a.y, a.width, a.height);
return false;
}
}
#endif
@ -137,6 +145,14 @@ void wxStaticBox::SetLabel( const wxString& label )
void wxStaticBox::DoApplyWidgetStyle(GtkRcStyle *style)
{
GTKFrameApplyWidgetStyle(GTK_FRAME(m_widget), style);
if (m_wxwindow)
GTKApplyStyle(m_wxwindow, style);
#ifndef __WXGTK3__
g_signal_handlers_disconnect_by_func(m_widget, (void*)expose_event, this);
if (m_backgroundColour.IsOk())
g_signal_connect(m_widget, "expose-event", G_CALLBACK(expose_event), this);
#endif
}
bool wxStaticBox::GTKWidgetNeedsMnemonic() const