[gtk+] GtkFontChooser: Blocking the cursor change callbacks from happening on the deprecated widgets when s
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkFontChooser: Blocking the cursor change callbacks from happening on the deprecated widgets when s
- Date: Mon, 15 Aug 2011 23:51:05 +0000 (UTC)
commit 72a971b0e047c8bf0e37345ea2fe53d3a29c4bf7
Author: Alberto Ruiz <aruiz gnome org>
Date: Sun May 1 02:11:46 2011 +0100
GtkFontChooser: Blocking the cursor change callbacks from happening on the deprecated widgets when selecting the font from the fontselector
gtk/gtkfontchooser.c | 36 ++++++++++++++++++++++++++++++------
1 files changed, 30 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkfontchooser.c b/gtk/gtkfontchooser.c
index de1f272..83c6ece 100644
--- a/gtk/gtkfontchooser.c
+++ b/gtk/gtkfontchooser.c
@@ -110,7 +110,9 @@ struct _GtkFontSelectionPrivate
GtkListStore *_font_model;
GtkListStore *_face_model;
- gboolean ignore_update;
+ gboolean ignore_size;
+ gboolean ignore_face;
+ gboolean ignore_font;
#endif
};
@@ -578,7 +580,9 @@ gtk_font_selection_init (GtkFontSelection *fontsel)
priv->_font_model = NULL;
priv->_face_model = NULL;
- priv->ignore_update = FALSE;
+ priv->ignore_size = FALSE;
+ priv->ignore_face = FALSE;
+ priv->ignore_font = FALSE;
#endif /* GTK_DISABLE_DEPRECATED */
/* Getting the default size */
@@ -1059,10 +1063,10 @@ update_font_list_selection (GtkFontSelection *fontsel)
tv = gtk_bin_get_child (GTK_BIN (priv->font_list));
+ priv->ignore_font = TRUE;
gtk_tree_view_set_cursor (GTK_TREE_VIEW (tv), path, NULL, FALSE);
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (tv), path, NULL, FALSE, 0.0, 0.0);
-
/* Free resources */
gtk_tree_path_free (path);
g_free (family_name);
@@ -1080,7 +1084,6 @@ update_face_model (GtkFontSelection *fontsel)
int i, n_faces;
pango_font_family_list_faces (priv->family, &faces, &n_faces);
- pango_font_family_get_name (priv->family);
gtk_list_store_clear (priv->_face_model);
@@ -1105,7 +1108,7 @@ update_face_model (GtkFontSelection *fontsel)
continue;
tv = gtk_bin_get_child (GTK_BIN (priv->face_list));
-
+ priv->ignore_face = TRUE;
gtk_tree_view_set_cursor (GTK_TREE_VIEW (tv), path, NULL, FALSE);
gtk_tree_path_free (path);
@@ -1141,6 +1144,7 @@ update_size_list_selection (GtkFontSelection *fontsel)
break;
tv = gtk_bin_get_child (GTK_BIN (priv->size_list));
+ priv->ignore_size = TRUE;
gtk_tree_view_set_cursor (GTK_TREE_VIEW (tv), path, NULL, FALSE);
gtk_tree_path_free (path);
@@ -1155,18 +1159,38 @@ size_list_cursor_changed_cb (GtkTreeView *treeview, gpointer data)
{
GtkFontSelection *fontsel = (GtkFontSelection*)data;
+ if (fontsel->priv->ignore_size)
+ {
+ fontsel->priv->ignore_size = FALSE;
+ return;
+ }
+ g_debug ("size");
}
static void
family_list_cursor_changed_cb (GtkTreeView *treeview, gpointer data)
{
GtkFontSelection *fontsel = (GtkFontSelection*)data;
-
+
+
+ if (fontsel->priv->ignore_font)
+ {
+ fontsel->priv->ignore_font = FALSE;
+ return;
+ }
+ g_debug ("family");
}
face_list_cursor_changed_cb (GtkTreeView *treeview, gpointer data)
{
GtkFontSelection *fontsel = (GtkFontSelection*)data;
+
+ if (fontsel->priv->ignore_face)
+ {
+ fontsel->priv->ignore_face = FALSE;
+ return;
+ }
+ g_debug ("face");
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]