diff options
author | Benjamin Otte <otte@redhat.com> | 2015-02-15 05:37:19 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-02-16 23:57:03 +0100 |
commit | 295b8aab0c1be8bf4437637f9b69ed1c368df489 (patch) | |
tree | 294cc5c046e01481b247144f3599bd62d409505b /gtk/gtkcssenumvalue.c | |
parent | 0c4a42e6295bd2546263502fb9867c3f075a2bf4 (diff) | |
download | gtk+-295b8aab0c1be8bf4437637f9b69ed1c368df489.tar.gz |
css: Implement animations for font-weight property
Diffstat (limited to 'gtk/gtkcssenumvalue.c')
-rw-r--r-- | gtk/gtkcssenumvalue.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gtk/gtkcssenumvalue.c b/gtk/gtkcssenumvalue.c index 502df3e59e..e9ee788bb6 100644 --- a/gtk/gtkcssenumvalue.c +++ b/gtk/gtkcssenumvalue.c @@ -419,11 +419,27 @@ gtk_css_value_font_weight_compute (GtkCssValue *value, return _gtk_css_font_weight_value_new (new_weight); } +static GtkCssValue * +gtk_css_value_font_weight_transition (GtkCssValue *start, + GtkCssValue *end, + guint property_id, + double progress) +{ + PangoWeight new_weight; + + if (start->value < 0 || end->value < 0) + return NULL; + + new_weight = (start->value + end->value + 50) / 200 * 100; + + return _gtk_css_font_weight_value_new (new_weight); +} + static const GtkCssValueClass GTK_CSS_VALUE_FONT_WEIGHT = { gtk_css_value_enum_free, gtk_css_value_font_weight_compute, gtk_css_value_enum_equal, - gtk_css_value_enum_transition, + gtk_css_value_font_weight_transition, gtk_css_value_enum_print }; |