[gtk+/font-chooser: 28/84] GtkFontChooser: Fixed size updating in the preview
- From: Alberto Ruiz <aruiz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/font-chooser: 28/84] GtkFontChooser: Fixed size updating in the preview
- Date: Fri, 20 May 2011 09:00:51 +0000 (UTC)
commit edd7fc6ed269bed233c4d35a52f5cb9684cd0110
Author: Alberto Ruiz <aruiz gnome org>
Date: Sat Apr 16 18:02:52 2011 +0100
GtkFontChooser: Fixed size updating in the preview
gtk/gtkfontchooser.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkfontchooser.c b/gtk/gtkfontchooser.c
index f2d704a..10e989e 100644
--- a/gtk/gtkfontchooser.c
+++ b/gtk/gtkfontchooser.c
@@ -328,6 +328,7 @@ slider_change_cb (GtkAdjustment *adjustment, gpointer data)
void
spin_change_cb (GtkAdjustment *adjustment, gpointer data)
{
+ PangoFontDescription *desc;
GtkFontSelectionPrivate *priv = (GtkFontSelectionPrivate*)data;
gdouble size = gtk_adjustment_get_value (adjustment);
@@ -347,6 +348,12 @@ spin_change_cb (GtkAdjustment *adjustment, gpointer data)
}
priv->size = ((gint)gtk_adjustment_get_value (adjustment)) * 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_modify_font (priv->preview, desc);
+
+ gtk_widget_queue_draw (priv->preview);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]