diff options
author | Benjamin Otte <otte@redhat.com> | 2012-10-01 18:21:30 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-10-02 14:16:35 +0200 |
commit | 25271fe781df135b72c9e95a6551d6f4017d9c1b (patch) | |
tree | 63ec12628ca1f01d8c070ed7749870b82a829665 /gtk/gtkcssnumbervalue.c | |
parent | 83c66c9c2cf6bf411f7d5ae3c89259203626173a (diff) | |
download | gtk+-25271fe781df135b72c9e95a6551d6f4017d9c1b.tar.gz |
css: Move special case code for border widths
We need to store the border widths independant of them being set to 0 by
border styles, because otherwise we'd need to track that dependency and
recompute on changes, and I don't want to add more entries to
GtkCssDependencies just for this special case.
By moving the code that does the setting to 0 from the compute stage to
the query stage, we can achieve this.
Now we need to just be aware that the actual value stored is not set to
0 when we use gtk_css_computed_values_get_value().
Diffstat (limited to 'gtk/gtkcssnumbervalue.c')
-rw-r--r-- | gtk/gtkcssnumbervalue.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/gtk/gtkcssnumbervalue.c b/gtk/gtkcssnumbervalue.c index 58f4652511..8d7eaa96ee 100644 --- a/gtk/gtkcssnumbervalue.c +++ b/gtk/gtkcssnumbervalue.c @@ -42,40 +42,6 @@ gtk_css_value_number_compute (GtkCssValue *number, GtkCssComputedValues *parent_values, GtkCssDependencies *dependencies) { - GtkBorderStyle border_style; - - /* I don't like this special case being here in this generic code path, but no idea where else to put it. */ - switch (property_id) - { - case GTK_CSS_PROPERTY_BORDER_TOP_WIDTH: - border_style = _gtk_css_border_style_value_get (_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_BORDER_TOP_STYLE)); - if (border_style == GTK_BORDER_STYLE_NONE || border_style == GTK_BORDER_STYLE_HIDDEN) - return _gtk_css_number_value_new (0, GTK_CSS_PX); - break; - case GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH: - border_style = _gtk_css_border_style_value_get (_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_BORDER_RIGHT_STYLE)); - if (border_style == GTK_BORDER_STYLE_NONE || border_style == GTK_BORDER_STYLE_HIDDEN) - return _gtk_css_number_value_new (0, GTK_CSS_PX); - break; - case GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH: - border_style = _gtk_css_border_style_value_get (_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_BORDER_BOTTOM_STYLE)); - if (border_style == GTK_BORDER_STYLE_NONE || border_style == GTK_BORDER_STYLE_HIDDEN) - return _gtk_css_number_value_new (0, GTK_CSS_PX); - break; - case GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH: - border_style = _gtk_css_border_style_value_get (_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_BORDER_LEFT_STYLE)); - if (border_style == GTK_BORDER_STYLE_NONE || border_style == GTK_BORDER_STYLE_HIDDEN) - return _gtk_css_number_value_new (0, GTK_CSS_PX); - break; - case GTK_CSS_PROPERTY_OUTLINE_WIDTH: - border_style = _gtk_css_border_style_value_get (_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_OUTLINE_STYLE)); - if (border_style == GTK_BORDER_STYLE_NONE || border_style == GTK_BORDER_STYLE_HIDDEN) - return _gtk_css_number_value_new (0, GTK_CSS_PX); - break; - default: - break; - } - switch (number->unit) { default: |