aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-sound.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-03-18 18:06:12 +0000
committerConor Curran <conor.curran@canonical.com>2010-03-18 18:06:12 +0000
commitc2be40c8f9ce0d6c678c04faa747ba50a22c6159 (patch)
tree2ebfca1a1e05dc94faeba9a08002e304944ae4a1 /src/indicator-sound.c
parent2546e03236f83bea869b628b095a61a30d76f15f (diff)
downloadayatana-indicator-sound-c2be40c8f9ce0d6c678c04faa747ba50a22c6159.tar.gz
ayatana-indicator-sound-c2be40c8f9ce0d6c678c04faa747ba50a22c6159.tar.bz2
ayatana-indicator-sound-c2be40c8f9ce0d6c678c04faa747ba50a22c6159.zip
scrolling now should move at 1% as opposed to 0.5% increments, cannot now scroll on panel icon when muted or no device available
Diffstat (limited to 'src/indicator-sound.c')
-rw-r--r--src/indicator-sound.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index e9a8e73..a1a531a 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -249,7 +249,7 @@ static gboolean new_slider_item(DbusmenuMenuitem * newitem, DbusmenuMenuitem * p
io = g_object_get_data (G_OBJECT (client), "indicator");
- volume_slider = ido_scale_menu_item_new_with_range ("Volume", initial_volume_percent, 0, 100, 0.5);
+ volume_slider = ido_scale_menu_item_new_with_range ("Volume", initial_volume_percent, 0, 100, 1);
g_object_set(volume_slider, "reverse-scroll-events", TRUE, NULL);
g_signal_connect (volume_slider,
@@ -671,15 +671,18 @@ static gboolean key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer dat
static void
scroll (IndicatorObject *io, gint delta, IndicatorScrollDirection direction)
{
- IndicatorSound *sound = INDICATOR_SOUND (io);
- GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE (sound->slider));
- gdouble value = gtk_range_get_value (GTK_RANGE (sound->slider));
+ if (device_available == FALSE || current_state == STATE_MUTED)
+ return;
+
+ IndicatorSound *sound = INDICATOR_SOUND (io);
+ GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE (sound->slider));
+ gdouble value = gtk_range_get_value (GTK_RANGE (sound->slider));
- if (direction == INDICATOR_OBJECT_SCROLL_UP)
+ if (direction == INDICATOR_OBJECT_SCROLL_UP)
value += adj->step_increment;
- else
+ else
value -= adj->step_increment;
- gtk_range_set_value (GTK_RANGE (sound->slider),
+ gtk_range_set_value (GTK_RANGE (sound->slider),
value);
}