aboutsummaryrefslogtreecommitdiff
path: root/src/volume-widget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/volume-widget.c')
-rw-r--r--src/volume-widget.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/volume-widget.c b/src/volume-widget.c
index ceebec5..be97994 100644
--- a/src/volume-widget.c
+++ b/src/volume-widget.c
@@ -37,6 +37,7 @@ struct _VolumeWidgetPrivate
DbusmenuMenuitem* twin_item;
GtkWidget* ido_volume_slider;
gboolean grabbed;
+ IndicatorObject* indicator;
};
#define VOLUME_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VOLUME_WIDGET_TYPE, VolumeWidgetPrivate))
@@ -137,6 +138,14 @@ volume_widget_property_update( DbusmenuMenuitem* item, gchar* property,
gdouble update = g_variant_get_double (value);
//g_debug("volume-widget - update level with value %f", update);
gtk_range_set_value(range, update);
+
+ GList *entry = indicator_object_get_entries(priv->indicator);
+ g_signal_emit(G_OBJECT(priv->indicator),
+ INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID,
+ 0,
+ entry->data,
+ TRUE);
+ g_list_free(entry);
}
}
}
@@ -156,6 +165,14 @@ volume_widget_set_twin_item(VolumeWidget* self,
GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_volume_slider);
GtkRange *range = (GtkRange*)slider;
gtk_range_set_value(range, initial_level);
+
+ GList *entry = indicator_object_get_entries(priv->indicator);
+ g_signal_emit(G_OBJECT(priv->indicator),
+ INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID,
+ 0,
+ entry->data,
+ TRUE);
+ g_list_free(entry);
}
static gboolean
@@ -251,10 +268,12 @@ volume_widget_get_current_volume ( GtkWidget *widget )
* volume_widget_new:
* @returns: a new #VolumeWidget.
**/
-GtkWidget*
-volume_widget_new(DbusmenuMenuitem *item)
+GtkWidget*
+volume_widget_new(DbusmenuMenuitem *item, IndicatorObject* io)
{
GtkWidget* widget = g_object_new(VOLUME_WIDGET_TYPE, NULL);
+ VolumeWidgetPrivate* priv = VOLUME_WIDGET_GET_PRIVATE(VOLUME_WIDGET(widget));
+ priv->indicator = io;
volume_widget_set_twin_item((VolumeWidget*)widget, item);
return widget;
}