From 1ea2919f7b445d54dbffc7fd0b2638a5a12e228c Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 12 Apr 2012 13:46:10 -0700 Subject: ensure to set the name of the gtk range for atk --- src/volume-widget.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/volume-widget.c b/src/volume-widget.c index ac603c1..595e602 100644 --- a/src/volume-widget.c +++ b/src/volume-widget.c @@ -143,6 +143,13 @@ volume_widget_property_update( DbusmenuMenuitem* item, gchar* property, /* g_debug ("volume-widget::volume_widget_property_update - volume - value %f", update); */ + AtkObject* atk_object; + atk_object = gtk_widget_get_accessible(GTK_WIDGET(range)); + if (atk_object != NULL){ + gchar* desc = g_strdup_printf(_("Volume (%'.0f%%)"), + volume_widget_get_current_volume (GTK_WIDGET (userdata))); + atk_object_set_name (atk_object, desc); + } update_accessible_desc(priv->indicator); } } -- cgit v1.2.3 From 9740d6e7079ac8118d3a75d90b42ac40054449f3 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 12 Apr 2012 13:56:27 -0700 Subject: use instances available and don't cast --- src/volume-widget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/volume-widget.c b/src/volume-widget.c index 595e602..246963b 100644 --- a/src/volume-widget.c +++ b/src/volume-widget.c @@ -144,10 +144,10 @@ volume_widget_property_update( DbusmenuMenuitem* item, gchar* property, g_debug ("volume-widget::volume_widget_property_update - volume - value %f", update); */ AtkObject* atk_object; - atk_object = gtk_widget_get_accessible(GTK_WIDGET(range)); + atk_object = gtk_widget_get_accessible (slider); if (atk_object != NULL){ gchar* desc = g_strdup_printf(_("Volume (%'.0f%%)"), - volume_widget_get_current_volume (GTK_WIDGET (userdata))); + update); atk_object_set_name (atk_object, desc); } update_accessible_desc(priv->indicator); -- cgit v1.2.3 From a41f4d3cacb59fbef9544a736fc43f0340ff4a33 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 23 Apr 2012 11:31:29 -0700 Subject: set the desc prop on the menuitem, disregard the atk approach from the widget --- src/volume-widget.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/volume-widget.c b/src/volume-widget.c index 246963b..d9f8cd4 100644 --- a/src/volume-widget.c +++ b/src/volume-widget.c @@ -142,14 +142,19 @@ volume_widget_property_update( DbusmenuMenuitem* item, gchar* property, gtk_range_set_value(range, update); /* g_debug ("volume-widget::volume_widget_property_update - volume - value %f", update); -*/ AtkObject* atk_object; - atk_object = gtk_widget_get_accessible (slider); + atk_object = gtk_widget_get_accessible (priv->ido_volume_slider); if (atk_object != NULL){ - gchar* desc = g_strdup_printf(_("Volume (%'.0f%%)"), - update); atk_object_set_name (atk_object, desc); - } + + }*/ + + gchar* desc = g_strdup_printf(_("Volume (%'.0f%%)"), + update); + dbusmenu_menuitem_property_set (priv->twin_item, + DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC, + desc); + g_free (desc); update_accessible_desc(priv->indicator); } } -- cgit v1.2.3 From 2c3d9c4cbfb106b34716eda98e3beb2878756ae4 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 23 Apr 2012 12:23:37 -0700 Subject: make sure on start up it's set --- src/volume-widget.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/volume-widget.c b/src/volume-widget.c index d9f8cd4..02d0330 100644 --- a/src/volume-widget.c +++ b/src/volume-widget.c @@ -208,6 +208,13 @@ volume_widget_set_twin_item(VolumeWidget* self, initial_level = 0; } gtk_range_set_value(range, initial_level); + gchar* desc = g_strdup_printf(_("Volume (%'.0f%%)"), + initial_level); + dbusmenu_menuitem_property_set (priv->twin_item, + DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC, + desc); + g_free (desc); + } static gboolean -- cgit v1.2.3 From 6e076f02999d0010a355fb57f60d4e9b5e799460 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 23 Apr 2012 12:38:58 -0700 Subject: make sure on key press it updates atk --- src/volume-widget.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/volume-widget.c b/src/volume-widget.c index 02d0330..1258c20 100644 --- a/src/volume-widget.c +++ b/src/volume-widget.c @@ -135,10 +135,11 @@ volume_widget_property_update( DbusmenuMenuitem* item, gchar* property, if(g_ascii_strcasecmp(DBUSMENU_VOLUME_MENUITEM_LEVEL, property) == 0){ g_return_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE_DOUBLE) ); + gdouble update = g_variant_get_double (value); + if(priv->grabbed == FALSE){ GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_volume_slider); GtkRange *range = (GtkRange*)slider; - gdouble update = g_variant_get_double (value); gtk_range_set_value(range, update); /* g_debug ("volume-widget::volume_widget_property_update - volume - value %f", update); @@ -148,15 +149,14 @@ volume_widget_property_update( DbusmenuMenuitem* item, gchar* property, atk_object_set_name (atk_object, desc); }*/ - - gchar* desc = g_strdup_printf(_("Volume (%'.0f%%)"), - update); - dbusmenu_menuitem_property_set (priv->twin_item, - DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC, - desc); - g_free (desc); - update_accessible_desc(priv->indicator); } + gchar* desc = g_strdup_printf(_("Volume (%'.0f%%)"), + update); + dbusmenu_menuitem_property_set (priv->twin_item, + DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC, + desc); + g_free (desc); + update_accessible_desc(priv->indicator); } else if(g_ascii_strcasecmp(DBUSMENU_VOLUME_MENUITEM_MUTE, property) == 0){ g_return_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE_BOOLEAN)); @@ -214,7 +214,7 @@ volume_widget_set_twin_item(VolumeWidget* self, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC, desc); g_free (desc); - + } static gboolean -- cgit v1.2.3