summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-03-06 19:16:25 +0100
committerAleksander Morgado <aleksander@lanedo.com>2013-03-08 11:24:32 +0100
commit801dfd0689364e28b51a2003746ef4abd223bd9a (patch)
treee2a599b44633888fd563059a46e81238d30718c9
parenta36d29191cf14d51ef7c6c0e4541db4ff7ee226c (diff)
downloadgtk+-801dfd0689364e28b51a2003746ef4abd223bd9a.tar.gz
spinbutton: don't override initial text in non-numeric-only spin buttons
https://bugzilla.gnome.org/show_bug.cgi?id=695312
-rw-r--r--gtk/gtkspinbutton.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index bc1e4a8224..97b6527baf 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -1048,7 +1048,12 @@ gtk_spin_button_realize (GtkWidget *widget)
return_val = FALSE;
g_signal_emit (spin_button, spinbutton_signals[OUTPUT], 0, &return_val);
- if (return_val == FALSE)
+
+ /* If output wasn't processed explicitly by the method connected to the
+ * 'output' signal; and if we don't have any explicit 'text' set initially,
+ * fallback to the default output. */
+ if (!return_val &&
+ (spin_button->numeric || gtk_entry_get_text (GTK_ENTRY (spin_button)) == NULL))
gtk_spin_button_default_output (spin_button);
gtk_widget_queue_resize (GTK_WIDGET (spin_button));