mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
32550fd6fc
The result of calling update_property needs to be that the property is marked as set afterward, even if the value we pass happens to match the default value. After this change, scrollbars have value-now show up as zero in the accessiblity page of the inspector, even when that matches the lower bound. Test included. Fixes: #5886
33 lines
814 B
C
33 lines
814 B
C
#include <gtk/gtk.h>
|
|
|
|
static void
|
|
value_set_unset (void)
|
|
{
|
|
GtkAdjustment *adjustment = gtk_adjustment_new (0, 0, 100, 1, 10, 10);
|
|
GtkWidget *scrollbar = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, adjustment);
|
|
|
|
g_object_ref_sink (scrollbar);
|
|
|
|
gtk_test_accessible_assert_property (scrollbar, GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, 0.);
|
|
|
|
gtk_adjustment_set_value (adjustment, 10);
|
|
|
|
gtk_test_accessible_assert_property (scrollbar, GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, 10.);
|
|
|
|
gtk_adjustment_set_value (adjustment, 0);
|
|
|
|
gtk_test_accessible_assert_property (scrollbar, GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, 0.);
|
|
|
|
g_object_unref (scrollbar);
|
|
}
|
|
|
|
int
|
|
main (int argc, char *argv[])
|
|
{
|
|
gtk_test_init (&argc, &argv, NULL);
|
|
|
|
g_test_add_func ("/a11y/value/set-unset", value_set_unset);
|
|
|
|
return g_test_run ();
|
|
}
|