summaryrefslogtreecommitdiff
path: root/gtk/gtkcssenumvalue.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-12-01 16:22:04 +0100
committerBenjamin Otte <otte@redhat.com>2012-12-01 16:27:45 +0100
commit5942099f0003c5ceecfe219fa1aeffe647b170e8 (patch)
treeb282fd81289bcb55d8356913134d35b0d8c9fcba /gtk/gtkcssenumvalue.c
parent891a4ab347a5e9994b2ca41edd0669ad7f81735f (diff)
downloadgtk+-5942099f0003c5ceecfe219fa1aeffe647b170e8.tar.gz
cssvalue: Parse font sizes properly
As the last CSS property, font-size now is a proper number (when it's not a keyword).
Diffstat (limited to 'gtk/gtkcssenumvalue.c')
-rw-r--r--gtk/gtkcssenumvalue.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gtk/gtkcssenumvalue.c b/gtk/gtkcssenumvalue.c
index f4c17c4ae8..f91ba889a2 100644
--- a/gtk/gtkcssenumvalue.c
+++ b/gtk/gtkcssenumvalue.c
@@ -133,8 +133,8 @@ _gtk_css_border_style_value_get (const GtkCssValue *value)
*/
#define DEFAULT_FONT_SIZE 10
-static double
-get_default_font_size (GtkStyleProviderPrivate *provider)
+double
+_gtk_css_font_size_get_default (GtkStyleProviderPrivate *provider)
{
GtkSettings *settings;
PangoFontDescription *description;
@@ -173,35 +173,35 @@ gtk_css_value_font_size_compute (GtkCssValue *value,
switch (value->value)
{
case GTK_CSS_FONT_SIZE_XX_SMALL:
- font_size = get_default_font_size (provider) * 3. / 5;
+ font_size = _gtk_css_font_size_get_default (provider) * 3. / 5;
break;
case GTK_CSS_FONT_SIZE_X_SMALL:
- font_size = get_default_font_size (provider) * 3. / 4;
+ font_size = _gtk_css_font_size_get_default (provider) * 3. / 4;
break;
case GTK_CSS_FONT_SIZE_SMALL:
- font_size = get_default_font_size (provider) * 8. / 9;
+ font_size = _gtk_css_font_size_get_default (provider) * 8. / 9;
break;
default:
g_assert_not_reached ();
/* fall thru */
case GTK_CSS_FONT_SIZE_MEDIUM:
- font_size = get_default_font_size (provider);
+ font_size = _gtk_css_font_size_get_default (provider);
break;
case GTK_CSS_FONT_SIZE_LARGE:
- font_size = get_default_font_size (provider) * 6. / 5;
+ font_size = _gtk_css_font_size_get_default (provider) * 6. / 5;
break;
case GTK_CSS_FONT_SIZE_X_LARGE:
- font_size = get_default_font_size (provider) * 3. / 2;
+ font_size = _gtk_css_font_size_get_default (provider) * 3. / 2;
break;
case GTK_CSS_FONT_SIZE_XX_LARGE:
- font_size = get_default_font_size (provider) * 2;
+ font_size = _gtk_css_font_size_get_default (provider) * 2;
break;
case GTK_CSS_FONT_SIZE_SMALLER:
*dependencies = GTK_CSS_DEPENDS_ON_PARENT;
if (parent_values)
font_size = _gtk_css_number_value_get (_gtk_css_computed_values_get_value (parent_values, GTK_CSS_PROPERTY_FONT_SIZE), 100);
else
- font_size = get_default_font_size (provider);
+ font_size = _gtk_css_font_size_get_default (provider);
/* XXX: This is what WebKit does... */
font_size *= 1.2;
break;
@@ -210,7 +210,7 @@ gtk_css_value_font_size_compute (GtkCssValue *value,
if (parent_values)
font_size = _gtk_css_number_value_get (_gtk_css_computed_values_get_value (parent_values, GTK_CSS_PROPERTY_FONT_SIZE), 100);
else
- font_size = get_default_font_size (provider);
+ font_size = _gtk_css_font_size_get_default (provider);
/* XXX: This is what WebKit does... */
font_size /= 1.2;
break;