From 7d57ffab8507073902c0f1ef01247aa06e4fa0e9 Mon Sep 17 00:00:00 2001 From: Karl Tomlinson Date: Tue, 7 Jun 2016 16:11:51 +1200 Subject: [PATCH] Bug 1250704 - use style from WidgetStyleCache for tooltip colors. r=stransky MozReview-Commit-ID: 9xzL8ckxTRQ --HG-- extra : rebase_source : 6855183140e76ce1c40f403bbcbfa29b98f8ed8f --- widget/gtk/nsLookAndFeel.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/widget/gtk/nsLookAndFeel.cpp b/widget/gtk/nsLookAndFeel.cpp index c190becec8db..3e3437be9a42 100644 --- a/widget/gtk/nsLookAndFeel.cpp +++ b/widget/gtk/nsLookAndFeel.cpp @@ -31,6 +31,7 @@ #if MOZ_WIDGET_GTK != 2 #include +#include "WidgetStyleCache.h" #endif using mozilla::LookAndFeel; @@ -1135,15 +1136,15 @@ nsLookAndFeel::Init() gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); sMozWindowText = GDK_RGBA_TO_NS_RGBA(color); gtk_style_context_restore(style); + g_object_unref(style); // tooltip foreground and background - gtk_style_context_add_class(style, GTK_STYLE_CLASS_TOOLTIP); - gtk_style_context_add_class(style, GTK_STYLE_CLASS_BACKGROUND); + style = ClaimStyleContext(MOZ_GTK_TOOLTIP); gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); sInfoBackground = GDK_RGBA_TO_NS_RGBA(color); gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); sInfoText = GDK_RGBA_TO_NS_RGBA(color); - g_object_unref(style); + ReleaseStyleContext(style); // menu foreground & menu background GtkWidget *accel_label = gtk_accel_label_new("M");