[goffice] Font Selector: keep the selected font, if possible, when filter changes.



commit d447bc6e318157130736653b13298d893e144421
Author: Morten Welinder <terra gnome org>
Date:   Thu Mar 14 22:27:07 2013 -0400

    Font Selector: keep the selected font, if possible, when filter changes.

 goffice/gtk/go-font-sel.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/goffice/gtk/go-font-sel.c b/goffice/gtk/go-font-sel.c
index 0bc5ed1..0d09996 100644
--- a/goffice/gtk/go-font-sel.c
+++ b/goffice/gtk/go-font-sel.c
@@ -238,7 +238,10 @@ gfs_fill_font_name_list (GOFontSel *gfs)
                            !gfs->filter_func (family, face, gfs->filter_data))
                                continue;
 
-                       if (!any_face) {
+                       if (any_face) {
+                               if (!gfs->show_style)
+                                       break;
+                       } else {
                                any_face = TRUE;
 
                                g_hash_table_insert (gfs->family_by_name,
@@ -689,8 +692,12 @@ gfs_font_chooser_set_filter_func (GtkFontChooser    *chooser,
        gfs->filter_data = filter_data;
        gfs->filter_data_destroy = data_destroy;
 
-       if (gfs->font_name_list)
+       if (gfs->font_name_list) {
+               PangoFontDescription *desc = go_font_sel_get_font_desc (gfs);
                gfs_fill_font_name_list (gfs);
+               go_font_sel_set_font_desc (gfs, desc);
+               pango_font_description_free (desc);
+       }
 }
 
 static PangoFontFamily *


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