summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColomban Wendling <[email protected]>2024-06-26 12:00:34 +0200
committerColomban Wendling <[email protected]>2024-06-26 12:00:34 +0200
commitfe495df3ec39c155eacecbfbfbdd3d6ad45c46ec (patch)
treeefd268e9dcbe5263a462d631c39a79923fde068a
parent6d146a7d1f21e3ee9baff915c494810f6e777e3f (diff)
downloadmate-calc-fe495df3ec39c155eacecbfbfbdd3d6ad45c46ec.tar.bz2
mate-calc-fe495df3ec39c155eacecbfbfbdd3d6ad45c46ec.tar.xz
a11y: Allow the screen reader to announce status changes
Make the equation status the description of the equation entry as well so the screen reader can notify the user when it changes while the entry has focus. Fixes #223.
-rw-r--r--src/math-display.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/math-display.c b/src/math-display.c
index b0f3e0e..6422247 100644
--- a/src/math-display.c
+++ b/src/math-display.c
@@ -302,7 +302,10 @@ key_press_cb(MathDisplay *display, GdkEventKey *event)
static void
status_changed_cb(MathEquation *equation, GParamSpec *spec, MathDisplay *display)
{
- gtk_text_buffer_set_text(display->priv->info_buffer, math_equation_get_status(equation), -1);
+ const gchar *status = math_equation_get_status(equation);
+
+ gtk_text_buffer_set_text(display->priv->info_buffer, status, -1);
+ atk_object_set_description(gtk_widget_get_accessible(display->priv->text_view), status);
if (math_equation_in_solve(equation) && !gtk_widget_get_visible(display->priv->spinner)) {
gtk_widget_show(display->priv->spinner);
gtk_spinner_start(GTK_SPINNER(display->priv->spinner));