summaryrefslogtreecommitdiff
path: root/gtk/gtkfontbutton.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-09-22 21:27:22 +0200
committerBenjamin Otte <otte@redhat.com>2011-09-22 21:44:05 +0200
commitd5bc1b66d22f100cf5b4851be65ac054748ce86c (patch)
treee65b582d06d563fade28673590ba5f7ea811e58d /gtk/gtkfontbutton.c
parent19623af04e48ab39b2831ae0a600b56f2df25e0c (diff)
downloadgtk+-d5bc1b66d22f100cf5b4851be65ac054748ce86c.tar.gz
fontbutton: Properly update label after property changes
Previously, the font wasn't properly updated after some changes.
Diffstat (limited to 'gtk/gtkfontbutton.c')
-rw-r--r--gtk/gtkfontbutton.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/gtk/gtkfontbutton.c b/gtk/gtkfontbutton.c
index 96467b084e..f7d65efb95 100644
--- a/gtk/gtkfontbutton.c
+++ b/gtk/gtkfontbutton.c
@@ -794,12 +794,9 @@ gtk_font_button_set_use_font (GtkFontButton *font_button,
{
font_button->priv->use_font = use_font;
- if (use_font)
- gtk_font_button_label_use_font (font_button);
- else
- gtk_widget_set_style (font_button->priv->font_label, NULL);
+ gtk_font_button_label_use_font (font_button);
- g_object_notify (G_OBJECT (font_button), "use-font");
+ g_object_notify (G_OBJECT (font_button), "use-font");
}
}
@@ -842,8 +839,7 @@ gtk_font_button_set_use_size (GtkFontButton *font_button,
{
font_button->priv->use_size = use_size;
- if (font_button->priv->use_font)
- gtk_font_button_label_use_font (font_button);
+ gtk_font_button_label_use_font (font_button);
g_object_notify (G_OBJECT (font_button), "use-size");
}
@@ -1147,17 +1143,20 @@ gtk_font_button_label_use_font (GtkFontButton *font_button)
{
PangoFontDescription *desc;
- if (!font_button->priv->use_font)
- return;
-
- desc = pango_font_description_copy (font_button->priv->font_desc);
+ if (font_button->priv->use_font)
+ {
+ desc = pango_font_description_copy (font_button->priv->font_desc);
- if (!font_button->priv->use_size)
- pango_font_description_unset_fields (desc, PANGO_FONT_MASK_SIZE);
+ if (!font_button->priv->use_size)
+ pango_font_description_unset_fields (desc, PANGO_FONT_MASK_SIZE);
+ }
+ else
+ desc = NULL;
- gtk_widget_modify_font (font_button->priv->font_label, desc);
+ gtk_widget_override_font (font_button->priv->font_label, desc);
- pango_font_description_free (desc);
+ if (desc)
+ pango_font_description_free (desc);
}
static void