mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-07 01:00:28 +00:00
csscustomproperty: Move compute code to GtkCssTypedValue
This way, we don't need the print_value vfunc anymore.
This commit is contained in:
parent
c9b918b70f
commit
36c79712a1
@ -122,22 +122,9 @@ _gtk_css_custom_property_class_init (GtkCssCustomPropertyClass *klass)
|
||||
property_class->assign = gtk_css_custom_property_assign;
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_custom_property_compute_value (GtkCssStyleProperty *property,
|
||||
GtkStyleContext *context,
|
||||
GtkCssValue *specified)
|
||||
{
|
||||
GtkCssCustomProperty *custom = GTK_CSS_CUSTOM_PROPERTY (property);
|
||||
|
||||
return _gtk_css_style_compute_value (context, custom->pspec->value_type, specified);
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_css_custom_property_init (GtkCssCustomProperty *custom)
|
||||
{
|
||||
GtkCssStyleProperty *style = GTK_CSS_STYLE_PROPERTY (custom);
|
||||
|
||||
style->compute_value = gtk_css_custom_property_compute_value;
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include "gtkcsstypedvalueprivate.h"
|
||||
|
||||
#include "gtkcsscustompropertyprivate.h"
|
||||
#include "gtkcssstylefuncsprivate.h"
|
||||
|
||||
struct _GtkCssValue {
|
||||
@ -38,7 +39,9 @@ gtk_css_value_typed_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleContext *context)
|
||||
{
|
||||
return _gtk_css_value_ref (value);
|
||||
GtkCssCustomProperty *custom = GTK_CSS_CUSTOM_PROPERTY (_gtk_css_style_property_lookup_by_id (property_id));
|
||||
|
||||
return _gtk_css_style_compute_value (context, custom->pspec->value_type, value);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
Loading…
Reference in New Issue
Block a user