[gtk/ebassi/new-a11y: 69/71] a11y: Update GtkProgressBar



commit bde8a408dc90d7ae3f872b16da99c7e801dc60a5
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jul 17 13:10:18 2020 -0400

    a11y: Update GtkProgressBar
    
    Update state and properties as appropriate.

 gtk/gtkprogressbar.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
---
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index 21c3b790f3..a8064eb461 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -643,6 +643,9 @@ gtk_progress_bar_act_mode_enter (GtkProgressBar *pbar)
   gboolean inverted;
 
   gtk_widget_add_css_class (pbar->progress_widget, GTK_STYLE_CLASS_PULSE);
+  gtk_accessible_update_state (GTK_ACCESSIBLE (pbar),
+                               GTK_ACCESSIBLE_STATE_BUSY, TRUE,
+                               -1);
 
   inverted = pbar->inverted;
   if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
@@ -680,6 +683,9 @@ gtk_progress_bar_act_mode_leave (GtkProgressBar *pbar)
     gtk_widget_remove_tick_callback (GTK_WIDGET (pbar), pbar->tick_id);
   pbar->tick_id = 0;
 
+  gtk_accessible_update_state (GTK_ACCESSIBLE (pbar),
+                               GTK_ACCESSIBLE_STATE_BUSY, FALSE,
+                               -1);
   gtk_widget_remove_css_class (pbar->progress_widget, GTK_STYLE_CLASS_PULSE);
   update_node_classes (pbar);
 }
@@ -730,6 +736,13 @@ gtk_progress_bar_set_fraction (GtkProgressBar *pbar,
   gtk_widget_queue_allocate (pbar->trough_widget);
   update_fraction_classes (pbar);
 
+  gtk_accessible_update_property (GTK_ACCESSIBLE (pbar),
+                                  GTK_ACCESSIBLE_PROPERTY_VALUE_MAX, 1.0,
+                                  GTK_ACCESSIBLE_PROPERTY_VALUE_MIN, 0.0,
+                                  GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, fraction,
+                                  -1);
+
+
   g_object_notify_by_pspec (G_OBJECT (pbar), progress_props[PROP_FRACTION]);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]