[gnome-builder] gstyle: properly update color widget color



commit 9b26e3e51b43b6861949d0b438622faa89ec79b5
Author: Sebastien Lafargue <slafargue gnome org>
Date:   Sun Jul 24 16:43:50 2016 +0200

    gstyle: properly update color widget color

 contrib/gstyle/gstyle-color-widget.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/contrib/gstyle/gstyle-color-widget.c b/contrib/gstyle/gstyle-color-widget.c
index 33de2a3..403cc74 100644
--- a/contrib/gstyle/gstyle-color-widget.c
+++ b/contrib/gstyle/gstyle-color-widget.c
@@ -721,9 +721,10 @@ gstyle_color_widget_draw (GtkWidget *widget,
                             "border-radius", &radius,
                             NULL);
 
-      gstyle_color_fill_rgba (self->color, &bg_color);
-      if (self->filter_func != NULL)
-        self->filter_func (&bg_color, &bg_color, self->filter_user_data);
+      if (self->filter_func != NULL && GSTYLE_IS_COLOR (self->filtered_color))
+        gstyle_color_fill_rgba (self->filtered_color, &bg_color);
+      else
+        gstyle_color_fill_rgba (self->color, &bg_color);
 
       cairo_new_path (cr);
       draw_cairo_round_box (cr, border_box, radius, radius, radius, radius);
@@ -967,7 +968,11 @@ gstyle_color_widget_set_filter_func (GstyleColorWidget    *self,
   self->filter_user_data = (filter_func == NULL) ? NULL : user_data;
 
   if (filter_func == NULL)
-    g_clear_object (&self->filtered_color);
+    {
+      g_clear_object (&self->filtered_color);
+      match_label_color (self, self->color);
+      update_label_visibility (self);
+    }
   else
     {
       gstyle_color_fill_rgba (self->color, &rgba);
@@ -982,6 +987,8 @@ gstyle_color_widget_set_filter_func (GstyleColorWidget    *self,
           update_label_visibility (self);
           g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_COLOR]);
         }
+
+      match_label_color (self, self->filtered_color);
     }
 
   gtk_widget_queue_draw (GTK_WIDGET (self));


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