[gtk/matthiasc/for-master: 2/4] spinbutton: Hide the buttons from accessibility
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 2/4] spinbutton: Hide the buttons from accessibility
- Date: Thu, 15 Oct 2020 20:33:56 +0000 (UTC)
commit aa4c0bf272f85df03297cc6f12bf5e5a6fe3db48
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Oct 15 16:05:02 2020 -0400
spinbutton: Hide the buttons from accessibility
The buttons here are not really buttons (the action
is not tied to the "clicked" signal), so triggering
the buttons via a11y does not have the expected effect.
And we expose the Value interface that ATs can use
to set the value.
gtk/gtkspinbutton.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index b0ff1672f0..cdba319f93 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -984,7 +984,10 @@ gtk_spin_button_init (GtkSpinButton *spin_button)
g_signal_connect (spin_button->entry, "activate", G_CALLBACK (gtk_spin_button_activate), spin_button);
gtk_widget_set_parent (spin_button->entry, GTK_WIDGET (spin_button));
- spin_button->down_button = gtk_button_new_from_icon_name ("value-decrease-symbolic");
+ spin_button->down_button = g_object_new (GTK_TYPE_BUTTON,
+ "accessible-role", GTK_ACCESSIBLE_ROLE_NONE,
+ "icon-name", "value-decrease-symbolic",
+ NULL);
gtk_widget_add_css_class (spin_button->down_button, "down");
gtk_widget_set_can_focus (spin_button->down_button, FALSE);
gtk_widget_set_parent (spin_button->down_button, GTK_WIDGET (spin_button));
@@ -998,10 +1001,12 @@ gtk_spin_button_init (GtkSpinButton *spin_button)
g_signal_connect (gesture, "released", G_CALLBACK (button_released_cb), spin_button);
g_signal_connect (gesture, "cancel", G_CALLBACK (button_cancel_cb), spin_button);
gtk_widget_add_controller (GTK_WIDGET (spin_button->down_button), GTK_EVENT_CONTROLLER (gesture));
- gtk_gesture_group (gtk_button_get_gesture (GTK_BUTTON (spin_button->down_button)),
- gesture);
+ gtk_gesture_group (gtk_button_get_gesture (GTK_BUTTON (spin_button->down_button)), gesture);
- spin_button->up_button = gtk_button_new_from_icon_name ("value-increase-symbolic");
+ spin_button->up_button = g_object_new (GTK_TYPE_BUTTON,
+ "accessible-role", GTK_ACCESSIBLE_ROLE_NONE,
+ "icon-name", "value-increase-symbolic",
+ NULL);
gtk_widget_add_css_class (spin_button->up_button, "up");
gtk_widget_set_can_focus (spin_button->up_button, FALSE);
gtk_widget_set_parent (spin_button->up_button, GTK_WIDGET (spin_button));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]