[geary/cherry-pick-543c7531] Merge branch 'mjog/608-gtk-style-context-log-spam' into 'mainline'



commit 10298f80afb6b7cc92e71354ce47493176e769dd
Author: Michael Gratton <mike vee net>
Date:   Sat Oct 26 06:47:03 2019 +0000

    Merge branch 'mjog/608-gtk-style-context-log-spam' into 'mainline'
    
    Fix ConversationList GtkStyleContext log spam
    
    Closes #608
    
    See merge request GNOME/geary!350
    
    (cherry picked from commit 543c7531862f8abf4468236ae37396862d9c8f46)
    
    876c1076 Fix ConversationList GtkStyleContext log spam

 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]