Commit d5bc1b66 authored by Benjamin Otte's avatar Benjamin Otte

fontbutton: Properly update label after property changes

Previously, the font wasn't properly updated after some changes.
parent 19623af0
......@@ -794,10 +794,7 @@ 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);
g_object_notify (G_OBJECT (font_button), "use-font");
}
......@@ -842,7 +839,6 @@ 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);
g_object_notify (G_OBJECT (font_button), "use-size");
......@@ -1147,16 +1143,19 @@ gtk_font_button_label_use_font (GtkFontButton *font_button)
{
PangoFontDescription *desc;
if (!font_button->priv->use_font)
return;
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);
}
else
desc = NULL;
gtk_widget_modify_font (font_button->priv->font_label, desc);
gtk_widget_override_font (font_button->priv->font_label, desc);
if (desc)
pango_font_description_free (desc);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment