[geary/mjog/608-gtk-style-context-log-spam] Fix ConversationList GtkStyleContext log spam



commit 876c10762884613e5516e0a4046a2bf515840122
Author: Michael Gratton <mike vee net>
Date:   Sat Oct 26 17:16:53 2019 +1100

    Fix ConversationList GtkStyleContext log spam
    
    Fixes #608

 src/client/conversation-list/formatted-conversation-data.vala | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/client/conversation-list/formatted-conversation-data.vala 
b/src/client/conversation-list/formatted-conversation-data.vala
index c969731f..e442564b 100644
--- a/src/client/conversation-list/formatted-conversation-data.vala
+++ b/src/client/conversation-list/formatted-conversation-data.vala
@@ -197,7 +197,15 @@ public class FormattedConversationData : Geary.BaseObject {
     }
 
     private Gdk.RGBA get_foreground_rgba(Gtk.Widget widget, bool selected) {
-        return widget.get_style_context().get_color(selected ? Gtk.StateFlags.SELECTED : 
Gtk.StateFlags.NORMAL);
+        // Do the https://bugzilla.gnome.org/show_bug.cgi?id=763796 dance
+        Gtk.StyleContext context = widget.get_style_context();
+        context.save();
+        context.set_state(
+            selected ? Gtk.StateFlags.SELECTED : Gtk.StateFlags.NORMAL
+        );
+        Gdk.RGBA colour = context.get_color(context.get_state());
+        context.restore();
+        return colour;
     }
 
     private string get_participants_markup(Gtk.Widget widget, bool selected) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]