Fix and Enable mouse wheel channel switching by default

This commit is contained in:
2026-05-06 13:10:30 -06:00
parent ad67af2f8f
commit 984ac9763e
4 changed files with 54 additions and 12 deletions

View File

@@ -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 ======= */