[gtk+/gtk-3-10] font chooser: Update font list on font changes



commit 3d626d9094dffd53bf343fc41c2eb4c401cc9b0d
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Mar 21 22:37:36 2014 -0400

    font chooser: Update font list on font changes
    
    We do get a style-updated emission when new fonts are installed.
    Update the font list in this case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726476

 gtk/gtkfontchooserwidget.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c
index 16f964d..c67b778 100644
--- a/gtk/gtkfontchooserwidget.c
+++ b/gtk/gtkfontchooserwidget.c
@@ -128,6 +128,8 @@ static void gtk_font_chooser_widget_finalize             (GObject         *objec
 static void gtk_font_chooser_widget_screen_changed       (GtkWidget       *widget,
                                                           GdkScreen       *previous_screen);
 
+static void gtk_font_chooser_widget_style_updated        (GtkWidget       *widget);
+
 static gboolean gtk_font_chooser_widget_find_font        (GtkFontChooserWidget *fontchooser,
                                                           const PangoFontDescription *font_desc,
                                                           GtkTreeIter          *iter);
@@ -481,6 +483,7 @@ gtk_font_chooser_widget_class_init (GtkFontChooserWidgetClass *klass)
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
   widget_class->screen_changed = gtk_font_chooser_widget_screen_changed;
+  widget_class->style_updated = gtk_font_chooser_widget_style_updated;
 
   gobject_class->finalize = gtk_font_chooser_widget_finalize;
   gobject_class->set_property = gtk_font_chooser_widget_set_property;
@@ -554,7 +557,6 @@ gtk_font_chooser_widget_init (GtkFontChooserWidget *fontchooser)
   /* Load data and set initial style dependant parameters */
   gtk_font_chooser_widget_load_fonts (fontchooser);
   gtk_font_chooser_widget_set_cell_size (fontchooser);
-
   gtk_font_chooser_widget_take_font_desc (fontchooser, NULL);
 }
 
@@ -898,6 +900,16 @@ gtk_font_chooser_widget_screen_changed (GtkWidget *widget,
   gtk_font_chooser_widget_load_fonts (fontchooser);
 }
 
+static void
+gtk_font_chooser_widget_style_updated (GtkWidget *widget)
+{
+  GtkFontChooserWidget *fontchooser = GTK_FONT_CHOOSER_WIDGET (widget);
+
+  GTK_WIDGET_CLASS (gtk_font_chooser_widget_parent_class)->style_updated (widget);
+ 
+  gtk_font_chooser_widget_load_fonts (fontchooser);
+}
+
 static PangoFontFamily *
 gtk_font_chooser_widget_get_family (GtkFontChooser *chooser)
 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]