[gtk+/font-selection-new: 26/73] GtkFontSelection: The spinner now updates the slider size if it is within the range
- From: Alberto Ruiz <aruiz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/font-selection-new: 26/73] GtkFontSelection: The spinner now updates the slider size if it is within the range
- Date: Sat, 7 May 2011 18:14:24 +0000 (UTC)
commit 360d1632031687780c8f18b8eb0136794022102b
Author: Alberto Ruiz <aruiz gnome org>
Date: Sat Apr 16 17:12:18 2011 +0100
GtkFontSelection: The spinner now updates the slider size if it is within the range
gtk/gtkfontsel.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c
index 89ea2e6..6349de2 100644
--- a/gtk/gtkfontsel.c
+++ b/gtk/gtkfontsel.c
@@ -304,8 +304,6 @@ icon_press_cb (GtkEntry *entry,
GdkEvent *event,
gpointer user_data)
{
- GtkFontSelectionPrivate *priv = (GtkFontSelectionPrivate*)user_data;
-
gtk_entry_buffer_delete_text (gtk_entry_get_buffer (entry), 0, -1);
}
@@ -322,7 +320,17 @@ void
spin_change_cb (GtkAdjustment *adjustment, gpointer data)
{
GtkFontSelectionPrivate *priv = (GtkFontSelectionPrivate*)data;
+
+ gdouble size = gtk_adjustment_get_value (adjustment);
+ GtkAdjustment *slider_adj = gtk_range_get_adjustment (GTK_RANGE (priv->size_slider));
+
+ if (size >= gtk_adjustment_get_lower (slider_adj) ||
+ size <= gtk_adjustment_get_upper (slider_adj))
+ {
+ gtk_adjustment_set_value (slider_adj, size);
+ }
+
priv->size = ((gint)gtk_adjustment_get_value (adjustment)) * PANGO_SCALE;
}
@@ -573,8 +581,8 @@ visible_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
-1);
/* Covering some corner cases to speed up the result */
- if ((font_name == NULL) ||
- (strlen (search_text) > strlen (font_name)))
+ if (font_name == NULL ||
+ strlen (search_text) > strlen (font_name))
{
g_free (font_name);
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]