summaryrefslogtreecommitdiff
path: root/gtk/gtkcssimagerecolor.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2020-01-20 09:22:02 +0100
committerTimm Bäder <mail@baedert.org>2020-01-24 06:08:39 +0100
commitd9652675eff7ebc64d6518c7014e8f29606cef76 (patch)
treebbc2cbde88a2bd3a290b060eea493564fa9de259 /gtk/gtkcssimagerecolor.c
parent685288216f8c23751a6b156921a5d6daf43d46eb (diff)
downloadgtk+-d9652675eff7ebc64d6518c7014e8f29606cef76.tar.gz
cssimagerecolor: Implement is_computed()
Diffstat (limited to 'gtk/gtkcssimagerecolor.c')
-rw-r--r--gtk/gtkcssimagerecolor.c10
1 files changed, 10 insertions, 0 deletions
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;
}