[gtk/wip/baedert/for-master: 737/748] cssimagerecolor: Implement is_computed()



commit d9652675eff7ebc64d6518c7014e8f29606cef76
Author: Timm Bäder <mail baedert org>
Date:   Mon Jan 20 09:22:02 2020 +0100

    cssimagerecolor: Implement is_computed()

 gtk/gtkcssimagerecolor.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/gtk/gtkcssimagerecolor.c b/gtk/gtkcssimagerecolor.c
index 36cc7bd9c4..4094de8a78 100644
--- a/gtk/gtkcssimagerecolor.c
+++ b/gtk/gtkcssimagerecolor.c
@@ -308,6 +308,15 @@ gtk_css_image_recolor_get_height (GtkCssImage *image)
   return gdk_texture_get_height (recolor->texture);
 }
 
+static gboolean
+gtk_css_image_recolor_is_computed (GtkCssImage *image)
+{
+  GtkCssImageRecolor *recolor = GTK_CSS_IMAGE_RECOLOR (image);
+
+  return recolor->texture &&
+         (!recolor->palette || gtk_css_value_is_computed (recolor->palette));
+}
+
 static void
 _gtk_css_image_recolor_class_init (GtkCssImageRecolorClass *klass)
 {
@@ -320,6 +329,7 @@ _gtk_css_image_recolor_class_init (GtkCssImageRecolorClass *klass)
   image_class->snapshot = gtk_css_image_recolor_snapshot;
   image_class->parse = gtk_css_image_recolor_parse;
   image_class->print = gtk_css_image_recolor_print;
+  image_class->is_computed = gtk_css_image_recolor_is_computed;
 
   object_class->dispose = gtk_css_image_recolor_dispose;
 }


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