aboutsummaryrefslogtreecommitdiff
path: root/src/uicmd.cc
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2024-01-11 22:41:27 +0100
committerRodrigo Arias Mallo <rodarima@gmail.com>2024-01-16 21:20:59 +0100
commit93d64e5c85045ebbcd4efc34d13bfce0549eb26b (patch)
tree4d447f62b406e60d8ecd7c292d078950a9116d2b /src/uicmd.cc
parentf012e861ff6b8107d64982a09125de5f3eb1c868 (diff)
Switch tabs using the mouse wheel
Allows switching tabs using the mouse wheel, which is useful to quickly scan pages by looking at the page content instead of the tab title.
Diffstat (limited to 'src/uicmd.cc')
-rw-r--r--src/uicmd.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/uicmd.cc b/src/uicmd.cc
index 7f2226dd..b4835b8a 100644
--- a/src/uicmd.cc
+++ b/src/uicmd.cc
@@ -246,6 +246,18 @@ int CustTabs::handle(int e)
a_Timeout_add(0.0, a_UIcmd_close_all_bw, NULL);
ret = 1;
}
+ } else if (e == FL_MOUSEWHEEL) {
+ /* Move to the next or previous tab using the mouse wheel */
+ int dx = Fl::event_dx();
+ int dy = Fl::event_dy();
+ int dir = dy ? dy : dx;
+
+ if (dir > 0)
+ next_tab();
+ else if (dir < 0)
+ prev_tab();
+
+ ret = 1;
}
return (ret) ? ret : Fl_Group::handle(e);