Save and restore GtkStyleContext in a few places that were not doing it

Does not fix any known problem, but seems prudent
This commit is contained in:
Paul Cornett
2016-08-31 10:01:27 -07:00
parent 1ba59a410f
commit 5d04f41d47
2 changed files with 6 additions and 0 deletions

View File

@@ -250,12 +250,14 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* widget,
stateFlag = GTK_STATE_FLAG_ACTIVE;
}
GtkStyleContext* sc = gtk_widget_get_style_context(widget);
gtk_style_context_save(sc);
GdkRGBA *fc, *bc;
wxNativeFontInfo info;
gtk_style_context_set_state(sc, stateFlag);
gtk_style_context_get(sc, stateFlag,
"color", &fc, "background-color", &bc,
GTK_STYLE_PROPERTY_FONT, &info.description, NULL);
gtk_style_context_restore(sc);
attr.colFg = wxColour(*fc);
attr.colBg = wxColour(*bc);
attr.font = wxFont(info);