diff options
author | Sebastien Bacher <seb128@ubuntu.com> | 2012-07-12 19:52:11 +0200 |
---|---|---|
committer | Sebastien Bacher <seb128@ubuntu.com> | 2012-07-12 19:52:11 +0200 |
commit | 612866753e2b554abb0b448ae6a8c8ce1c2f4d87 (patch) | |
tree | 03ced96344802a4e338eb53d35d1c677f8354460 /src/volume-widget.c | |
parent | 31b5a5a6508535ed1af86919c79d75571f1a65ef (diff) | |
parent | 2900797204c4446a7f46515364c6aa868a5f4fab (diff) | |
download | ayatana-indicator-sound-612866753e2b554abb0b448ae6a8c8ce1c2f4d87.tar.gz ayatana-indicator-sound-612866753e2b554abb0b448ae6a8c8ce1c2f4d87.tar.bz2 ayatana-indicator-sound-612866753e2b554abb0b448ae6a8c8ce1c2f4d87.zip |
Import upstream version 12.10.0
Diffstat (limited to 'src/volume-widget.c')
-rw-r--r-- | src/volume-widget.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/volume-widget.c b/src/volume-widget.c index ac603c1..1258c20 100644 --- a/src/volume-widget.c +++ b/src/volume-widget.c @@ -135,16 +135,28 @@ 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); -*/ - update_accessible_desc(priv->indicator); + AtkObject* atk_object; + atk_object = gtk_widget_get_accessible (priv->ido_volume_slider); + if (atk_object != NULL){ + 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); } 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)); @@ -196,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 |