aboutsummaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/indicator-sound.c17
2 files changed, 11 insertions, 8 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index b7de930..062d993 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,7 +13,7 @@ libsoundmenu_la_SOURCES = \
dbus-shared-names.h \
sound-service-client.h
-libsoundmenu_la_CFLAGS = $(APPLET_CFLAGS) -Wall -Werror
+libsoundmenu_la_CFLAGS = $(APPLET_CFLAGS) -Wall -Werror -DG_LOG_DOMAIN=\"Indicator-Sound\"
libsoundmenu_la_LIBADD = $(APPLET_LIBS)
libsoundmenu_la_LDFLAGS = -module -avoid-version
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);
}