From cfc871f031d5b704cf33743b1e488675d776db42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= Date: Tue, 23 Jul 2024 23:38:18 +0200 Subject: [PATCH] gtkspinbutton: Set number input hint for text field if numeric The main reason to do this is so that the OSK shows a numeric touchpad instead of the regular keyboard when the spin button only accepts numbers --- gtk/gtkspinbutton.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 0095ccbba5..298d0fd460 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -2294,6 +2294,8 @@ gtk_spin_button_set_numeric (GtkSpinButton *spin_button, if (spin_button->numeric != numeric) { spin_button->numeric = numeric; + gtk_text_set_input_purpose (GTK_TEXT (spin_button->entry), + numeric ? GTK_INPUT_PURPOSE_NUMBER: GTK_INPUT_PURPOSE_FREE_FORM); g_object_notify_by_pspec (G_OBJECT (spin_button), spinbutton_props[PROP_NUMERIC]); } }