From 3539afc759c268880c5b3027bbc97e5c02dd1263 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 16 Jan 2024 21:18:19 +0100 Subject: Add scroll_switches_tabs option By default, scrolling the mouse wheel over the tabs will switch among tabs. The option allows users to disable the feature. --- dillorc | 4 ++++ src/prefs.c | 1 + src/prefs.h | 1 + src/prefsparser.cc | 1 + src/uicmd.cc | 2 +- 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dillorc b/dillorc index 5f0b756e..60fe2f4b 100644 --- a/dillorc +++ b/dillorc @@ -380,6 +380,10 @@ ui_tab_bg_color=#b7beb7 # With mousewheel mouses, right click feels way better (set to YES). #right_click_closes_tab=YES +# Scroll over tabs (using the mouse wheel) to switch among tabs. +# If set to NO, the page will be scrolled instead. +#scroll_switches_tabs=YES + # Mouse middle click by default drives drag-scrolling. # To paste an URL into the window instead of scrolling, set it to NO. # Note: You could always paste the URL onto the URL box clear button. diff --git a/src/prefs.c b/src/prefs.c index d7403d76..c8a16d67 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -78,6 +78,7 @@ void a_Prefs_init(void) prefs.middle_click_drags_page = TRUE; prefs.middle_click_opens_new_tab = TRUE; prefs.right_click_closes_tab = TRUE; + prefs.scroll_switches_tabs = TRUE; prefs.no_proxy = dStrdup(PREFS_NO_PROXY); prefs.panel_size = P_medium; prefs.parse_embedded_css=TRUE; diff --git a/src/prefs.h b/src/prefs.h index 004b2850..9b9ee392 100644 --- a/src/prefs.h +++ b/src/prefs.h @@ -106,6 +106,7 @@ typedef struct { bool_t enterpress_forces_submit; bool_t middle_click_opens_new_tab; bool_t right_click_closes_tab; + bool_t scroll_switches_tabs; bool_t search_url_idx; Dlist *search_urls; char *save_dir; diff --git a/src/prefsparser.cc b/src/prefsparser.cc index d1711a12..b1b38775 100644 --- a/src/prefsparser.cc +++ b/src/prefsparser.cc @@ -186,6 +186,7 @@ void PrefsParser::parse(FILE *fp) { "middle_click_opens_new_tab", &prefs.middle_click_opens_new_tab, PREFS_BOOL, 0 }, { "right_click_closes_tab", &prefs.right_click_closes_tab, PREFS_BOOL, 0 }, + { "scroll_switches_tabs", &prefs.scroll_switches_tabs, PREFS_BOOL, 0 }, { "no_proxy", &prefs.no_proxy, PREFS_STRING, 0 }, { "panel_size", &prefs.panel_size, PREFS_PANEL_SIZE, 0 }, { "parse_embedded_css", &prefs.parse_embedded_css, PREFS_BOOL, 0 }, diff --git a/src/uicmd.cc b/src/uicmd.cc index b4835b8a..e153ba70 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -246,7 +246,7 @@ int CustTabs::handle(int e) a_Timeout_add(0.0, a_UIcmd_close_all_bw, NULL); ret = 1; } - } else if (e == FL_MOUSEWHEEL) { + } else if (e == FL_MOUSEWHEEL && prefs.scroll_switches_tabs) { /* Move to the next or previous tab using the mouse wheel */ int dx = Fl::event_dx(); int dy = Fl::event_dy(); -- cgit v1.2.3