Project

General

Profile

mswheel.patch

Netslovdlyasnov Netslovdlyasnov, April 06, 2012 18:43

View differences:

src/gtkui/ui_gtk.c
319 319
    volume_slider_is_moving = FALSE;
320 320
}
321 321

  
322
static void ui_volume_scroll(GtkButton *button, GdkEvent *event, gpointer user_data)
323
{
324
    if (event->scroll.direction == GDK_SCROLL_UP)
325
    {
326
      int vol = 0;
327
      aud_drct_get_volume_main (& vol);
328
      aud_drct_set_volume_main (vol + 5);
329
    }
330
    else if (event->scroll.direction == GDK_SCROLL_DOWN)
331
    {
332
      int vol = 0;
333
      aud_drct_get_volume_main (& vol);
334
      aud_drct_set_volume_main (vol - 5);
335
    }
336
}
337

  
322 338
static gboolean ui_volume_slider_update(gpointer data)
323 339
{
324 340
    gint volume;
......
826 842
    volume_change_handler_id = g_signal_connect(volume, "value-changed", G_CALLBACK(ui_volume_value_changed_cb), NULL);
827 843
    g_signal_connect(volume, "pressed", G_CALLBACK(ui_volume_pressed_cb), NULL);
828 844
    g_signal_connect(volume, "released", G_CALLBACK(ui_volume_released_cb), NULL);
845
    g_signal_connect(volume, "scroll-event", G_CALLBACK(ui_volume_scroll), NULL);
829 846
    update_volume_timeout_source = g_timeout_add(250, (GSourceFunc) ui_volume_slider_update, volume);
830 847

  
831 848
    g_signal_connect (window, "map-event", (GCallback) window_mapped_cb, NULL);