mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-05-16 21:50:20 +00:00
Fix and Enable mouse wheel channel switching by default
This commit is contained in:
@@ -95,6 +95,37 @@ static chan *cv_find_chan_by_number (chanview *cv, int num);
|
||||
static int cv_find_number_of_chan (chanview *cv, chan *find_ch);
|
||||
static void cv_find_neighbors_for_removal (chanview *cv, chan *find_ch, chan **left_ch, chan **first_ch);
|
||||
|
||||
static void
|
||||
cv_add_scroll_events (GtkWidget *widget)
|
||||
{
|
||||
gtk_widget_add_events (widget, GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK);
|
||||
}
|
||||
|
||||
static int
|
||||
cv_scroll_direction (GdkEventScroll *event)
|
||||
{
|
||||
gdouble dx;
|
||||
gdouble dy;
|
||||
|
||||
if (event->direction == GDK_SCROLL_SMOOTH && gdk_event_get_scroll_deltas ((GdkEvent *) event, &dx, &dy))
|
||||
{
|
||||
if (dy > 0)
|
||||
return 1;
|
||||
if (dy < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (event->direction)
|
||||
{
|
||||
case GDK_SCROLL_DOWN:
|
||||
return 1;
|
||||
case GDK_SCROLL_UP:
|
||||
return -1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ======= TABS ======= */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user