summaryrefslogtreecommitdiff
path: root/gtk/gtkprogressbar.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-05-27 16:04:29 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2020-06-05 20:35:10 +0100
commitac3f0df0834da27e4448a0b0e14c375736dcd384 (patch)
tree609f597e0a1f828481d2ae790b6f552e3db8d2ca /gtk/gtkprogressbar.c
parentf95d54a13d4de92a25855d2296b8d0b76743b403 (diff)
downloadgtk+-ac3f0df0834da27e4448a0b0e14c375736dcd384.tar.gz
a11y: Simplify GtkProgressBarAccessible
Drop the GtkWidgetAccessibleClass.notify_gtk and the AtkObjectClass.initialize overrides: they don't do anything relevant. Instead, have GtkProgressBar update the accessible state when the fraction changes.
Diffstat (limited to 'gtk/gtkprogressbar.c')
-rw-r--r--gtk/gtkprogressbar.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index 53104999aa..8490024f4b 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -39,7 +39,7 @@
#include "gtkstylecontextprivate.h"
#include "gtkwidgetprivate.h"
-#include "a11y/gtkprogressbaraccessible.h"
+#include "a11y/gtkprogressbaraccessibleprivate.h"
#include <string.h>
@@ -732,6 +732,14 @@ gtk_progress_bar_set_fraction (GtkProgressBar *pbar,
gtk_widget_queue_allocate (pbar->trough_widget);
update_fraction_classes (pbar);
+ {
+ AtkObject *accessible =
+ _gtk_widget_peek_accessible (GTK_WIDGET (pbar));
+
+ if (accessible != NULL)
+ gtk_progress_bar_accessible_update_value (GTK_PROGRESS_BAR_ACCESSIBLE (accessible));
+ }
+
g_object_notify_by_pspec (G_OBJECT (pbar), progress_props[PROP_FRACTION]);
}