summaryrefslogtreecommitdiff
path: root/gtk/gtkfontchooserwidget.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@gnome.org>2011-09-12 21:26:21 +0200
committerChristian Persch <chpe@gnome.org>2011-09-13 12:55:34 +0200
commit71c16bad3353202ca55fe15a092b3bcf7085097e (patch)
tree893e1a7f4dfec8c7cdb8a12e07d2aa6636d7a32c /gtk/gtkfontchooserwidget.c
parentd82895127e5424589cbc68de279b36d1d3375823 (diff)
downloadgtk+-71c16bad3353202ca55fe15a092b3bcf7085097e.tar.gz
Take font size also from the font description
Diffstat (limited to 'gtk/gtkfontchooserwidget.c')
-rw-r--r--gtk/gtkfontchooserwidget.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c
index 430228554d..af4bda5dfc 100644
--- a/gtk/gtkfontchooserwidget.c
+++ b/gtk/gtkfontchooserwidget.c
@@ -320,17 +320,19 @@ spin_change_cb (GtkAdjustment *adjustment,
GtkFontChooserWidget *fontchooser = (GtkFontChooserWidget*)user_data;
GtkFontChooserWidgetPrivate *priv = fontchooser->priv;
GtkAdjustment *slider_adj = gtk_range_get_adjustment (GTK_RANGE (priv->size_slider));
-
gdouble size = gtk_adjustment_get_value (adjustment);
+
priv->size = ((gint)size) * PANGO_SCALE;
desc = pango_context_get_font_description (gtk_widget_get_pango_context (priv->preview));
pango_font_description_set_size (desc, priv->size);
gtk_widget_override_font (priv->preview, desc);
- g_object_notify (G_OBJECT (fontchooser), "font");
- g_object_notify (G_OBJECT (fontchooser), "font-desc");
-
+ if (pango_font_description_get_size_is_absolute (priv->font_desc))
+ pango_font_description_set_absolute_size (priv->font_desc, size);
+ else
+ pango_font_description_set_size (priv->font_desc, priv->size);
+
/* If the new value is lower than the lower bound of the slider, we set
* the slider adjustment to the lower bound value if it is not already set
*/
@@ -350,6 +352,9 @@ spin_change_cb (GtkAdjustment *adjustment,
gtk_adjustment_set_value (slider_adj, size);
gtk_widget_queue_draw (priv->preview);
+
+ g_object_notify (G_OBJECT (fontchooser), "font");
+ g_object_notify (G_OBJECT (fontchooser), "font-desc");
}
static void