[gtk+/gtk-2-24] spinbutton: don't override initial text in non-numeric-only spin buttons
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24] spinbutton: don't override initial text in non-numeric-only spin buttons
- Date: Fri, 8 Mar 2013 10:24:11 +0000 (UTC)
commit b2a65ebfb67f093e88d6bcc80d5643b94d6c985d
Author: Aleksander Morgado <aleksander lanedo com>
Date: Wed Mar 6 19:16:25 2013 +0100
spinbutton: don't override initial text in non-numeric-only spin buttons
https://bugzilla.gnome.org/show_bug.cgi?id=695312
gtk/gtkspinbutton.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 29f1cc9..aadc7f8 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -577,7 +577,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));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]