summaryrefslogtreecommitdiff
path: root/gtk/gtkspinbutton.c
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:23:11 +0100
commit5bbbc47a4c306653e8347f7afb85a940a503f755 (patch)
treeb25a5030ead2e8a3575c1c0ac9248d7340df2ecd /gtk/gtkspinbutton.c
parent67f5e595a796a8321d6dc7737c58476564998c07 (diff)
downloadgtk+-5bbbc47a4c306653e8347f7afb85a940a503f755.tar.gz
spinbutton: don't override initial text in non-numeric-only spin buttons
https://bugzilla.gnome.org/show_bug.cgi?id=695312
Diffstat (limited to 'gtk/gtkspinbutton.c')
-rw-r--r--gtk/gtkspinbutton.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 2e071d9aca..f1a09c9639 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));