[Xfce4-commits] <midori:master> Count font names added to the list, to fix font combo boxes
Christian Dywan
noreply at xfce.org
Tue Sep 29 00:12:01 CEST 2009
Updating branch refs/heads/master
to 7a5329a1e0467c87d62faa972c0138a67da39b00 (commit)
from 6d31faecf3412b49663a08c2e3e7d453e9f87503 (commit)
commit 7a5329a1e0467c87d62faa972c0138a67da39b00
Author: Christian Dywan <christian at twotoasts.de>
Date: Mon Sep 28 23:54:39 2009 +0200
Count font names added to the list, to fix font combo boxes
katze/katze-utils.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/katze/katze-utils.c b/katze/katze-utils.c
index def1735..473d091 100644
--- a/katze/katze-utils.c
+++ b/katze/katze-utils.c
@@ -283,7 +283,7 @@ katze_property_proxy (gpointer object,
|| _hint == g_intern_string ("font-monospace")))
{
GtkComboBox* combo;
- int n_families, i;
+ gint n_families, i;
PangoContext* context;
PangoFontFamily** families;
gboolean monospace = _hint == g_intern_string ("font-monospace");
@@ -296,14 +296,18 @@ katze_property_proxy (gpointer object,
if (!string)
string = g_strdup (G_PARAM_SPEC_STRING (pspec)->default_value);
if (string)
- for (i = 0; i < n_families; i++)
{
- const gchar* font = pango_font_family_get_name (families[i]);
- if (monospace != pango_font_family_is_monospace (families[i]))
- continue;
- gtk_combo_box_append_text (combo, font);
- if (!g_ascii_strcasecmp (font, string))
- gtk_combo_box_set_active (combo, i);
+ gint j = 0;
+ for (i = 0; i < n_families; i++)
+ {
+ const gchar* font = pango_font_family_get_name (families[i]);
+ if (monospace != pango_font_family_is_monospace (families[i]))
+ continue;
+ gtk_combo_box_append_text (combo, font);
+ if (!g_ascii_strcasecmp (font, string))
+ gtk_combo_box_set_active (combo, j);
+ j++;
+ }
}
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (
gtk_combo_box_get_model (combo)), 0, GTK_SORT_ASCENDING);
More information about the Xfce4-commits
mailing list