mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 22:10:08 +00:00
volumebutton: Remove broken a11y code
The accessible of a button is not an AtkImage, so whatever this code was trying to do isn't working. Remove it.
This commit is contained in:
parent
1927a8af71
commit
9c5fc0fb7a
@ -78,13 +78,13 @@ enum
|
|||||||
PROP_SYMBOLIC
|
PROP_SYMBOLIC
|
||||||
};
|
};
|
||||||
|
|
||||||
static gboolean cb_query_tooltip (GtkWidget *button,
|
static gboolean cb_query_tooltip (GtkWidget *button,
|
||||||
gint x,
|
gint x,
|
||||||
gint y,
|
gint y,
|
||||||
gboolean keyboard_mode,
|
gboolean keyboard_mode,
|
||||||
GtkTooltip *tooltip,
|
GtkTooltip *tooltip,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
static void cb_value_changed (GtkVolumeButton *button,
|
static void cb_value_changed (GtkVolumeButton *button,
|
||||||
gdouble value,
|
gdouble value,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
@ -110,9 +110,9 @@ get_symbolic (GtkScaleButton *button)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_volume_button_set_property (GObject *object,
|
gtk_volume_button_set_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
GtkScaleButton *button = GTK_SCALE_BUTTON (object);
|
GtkScaleButton *button = GTK_SCALE_BUTTON (object);
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ gtk_volume_button_set_property (GObject *object,
|
|||||||
if (g_value_get_boolean (value))
|
if (g_value_get_boolean (value))
|
||||||
gtk_scale_button_set_icons (button, (const char **) icons_symbolic);
|
gtk_scale_button_set_icons (button, (const char **) icons_symbolic);
|
||||||
else
|
else
|
||||||
gtk_scale_button_set_icons (button, (const char **) icons);
|
gtk_scale_button_set_icons (button, (const char **) icons);
|
||||||
g_object_notify_by_pspec (object, pspec);
|
g_object_notify_by_pspec (object, pspec);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -136,9 +136,9 @@ gtk_volume_button_set_property (GObject *object,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_volume_button_get_property (GObject *object,
|
gtk_volume_button_get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
@ -192,7 +192,7 @@ gtk_volume_button_init (GtkVolumeButton *button)
|
|||||||
|
|
||||||
/* The atk action description is not supported by GtkBuilder */
|
/* The atk action description is not supported by GtkBuilder */
|
||||||
atk_action_set_description (ATK_ACTION (gtk_widget_get_accessible (GTK_WIDGET (widget))),
|
atk_action_set_description (ATK_ACTION (gtk_widget_get_accessible (GTK_WIDGET (widget))),
|
||||||
1, _("Adjusts the volume"));
|
1, _("Adjusts the volume"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -214,19 +214,16 @@ gtk_volume_button_new (void)
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
cb_query_tooltip (GtkWidget *button,
|
cb_query_tooltip (GtkWidget *button,
|
||||||
gint x,
|
gint x,
|
||||||
gint y,
|
gint y,
|
||||||
gboolean keyboard_mode,
|
gboolean keyboard_mode,
|
||||||
GtkTooltip *tooltip,
|
GtkTooltip *tooltip,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GtkScaleButton *scale_button = GTK_SCALE_BUTTON (button);
|
GtkScaleButton *scale_button = GTK_SCALE_BUTTON (button);
|
||||||
GtkAdjustment *adjustment;
|
GtkAdjustment *adjustment;
|
||||||
gdouble val;
|
gdouble val;
|
||||||
char *str;
|
char *str;
|
||||||
AtkImage *image;
|
|
||||||
|
|
||||||
image = ATK_IMAGE (gtk_widget_get_accessible (button));
|
|
||||||
|
|
||||||
adjustment = gtk_scale_button_get_adjustment (scale_button);
|
adjustment = gtk_scale_button_get_adjustment (scale_button);
|
||||||
val = gtk_scale_button_get_value (scale_button);
|
val = gtk_scale_button_get_value (scale_button);
|
||||||
@ -254,7 +251,6 @@ cb_query_tooltip (GtkWidget *button,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gtk_tooltip_set_text (tooltip, str);
|
gtk_tooltip_set_text (tooltip, str);
|
||||||
atk_image_set_image_description (image, str);
|
|
||||||
g_free (str);
|
g_free (str);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user