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
This commit is contained in:
Pablo Correa Gómez 2024-07-23 23:38:18 +02:00
parent 23e4c788fa
commit cfc871f031
No known key found for this signature in database
GPG Key ID: 7A342565FF635F79

View File

@ -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]);
}
}