Re: gnome-applets-mixer patch [3]



Sun, Apr 21, 2002 at 10:34:38PM +0200, Markus Bertheau escribió:

>> Attached the patch, please commit.
>
>You didn't :)

	Oooops. Here is it!

Salu2


-- 
Fernando Herrera de las Heras
Onírica: análisis, diseño e implantación de soluciones informáticas
http://www.onirica.com
--- mixer.c.orig	Wed Apr 17 17:13:05 2002
+++ mixer.c	Thu Apr 18 00:17:53 2002
@@ -334,11 +334,7 @@
 {
 	gint vol = data->vol;
 
-	if (IS_PANEL_HORIZONTAL (data->orientation)) {
-		vol = -vol;
-	} else {
-		vol = vol - VOLUME_MAX;
-	}
+	vol = -vol;
 	
 	gtk_adjustment_set_value (data->adj, vol);
 }
@@ -468,16 +464,32 @@
 
 
 static gboolean
-applet_scroll_event_cb (GtkWidget *widget, GdkEventKey *event, MixerData *data)
+applet_scroll_event_cb (GtkWidget *widget, GdkEventScroll *event, MixerData *data)
 {
-	if (event->type = GDK_SCROLL) {
-		if (data->popup != NULL)
-			mixer_popup_hide (data, FALSE);
-		else
-			mixer_popup_show (data);
-		return TRUE;
+	gint direction;	
+	if (event->type != GDK_SCROLL ) {
+		return FALSE;
 	}
-	return FALSE;
+
+	direction = event->direction;
+
+	switch(direction) {
+	case GDK_SCROLL_UP:
+		data->vol += 5;
+		break;
+	case GDK_SCROLL_DOWN:
+		data->vol -= 5;
+		break;
+	default:
+		break;
+	}
+
+	if (data->vol > VOLUME_MAX) data->vol = VOLUME_MAX;
+	if (data->vol < 0) data->vol = 0;
+
+	mixer_update_slider(data);
+
+	return TRUE;
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]