[GTK3] Use WidgetCache to get colors at nsLookAndFeel

This commit is contained in:
trav90 2018-04-06 07:41:32 -05:00 • committed by Roy Tam
commit 9461197f53
4 changed files with 38 additions and 46 deletions

View file

@ -1161,16 +1161,10 @@ nsLookAndFeel::Init()
style = ClaimStyleContext(MOZ_GTK_TOOLTIP);
gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color);
sInfoBackground = GDK_RGBA_TO_NS_RGBA(color);
{
GtkStyleContext* boxStyle =
CreateStyleForWidget(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0),
style);
GtkStyleContext* labelStyle =
CreateStyleForWidget(gtk_label_new(nullptr), boxStyle);
gtk_style_context_get_color(labelStyle, GTK_STATE_FLAG_NORMAL, &color);
g_object_unref(labelStyle);
g_object_unref(boxStyle);
}
ReleaseStyleContext(style);
style = ClaimStyleContext(MOZ_GTK_TOOLTIP_BOX_LABEL);
gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color);
sInfoText = GDK_RGBA_TO_NS_RGBA(color);
ReleaseStyleContext(style);