Hi Alex, On Fri, Apr 05, 2024 at 04:29:08PM +0200, a1ex@dismail.de wrote:
Hello friends,
This patch adds a preference to toggle the direction of scrolling tabs with the mouse wheel. I personally find it more intuitive reversed, though others might disagree, thus now there can be a choice :)
Regards, Alex
--- dillorc Sat Mar 9 18:43:51 2024 +++ dillorc Fri Apr 5 15:30:32 2024 @@ -384,6 +384,9 @@ # If set to NO, the page will be scrolled instead. #scroll_switches_tabs=YES
+# Reverse the direction of tab scrolling with mouse wheel. +#scroll_switches_tabs_reverse=YES
The convention in dillorc is to set the defaults in comments, so this should be: #scroll_switches_tabs_reverse=NO
+ # 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.
--- src/prefs.c Sat Mar 9 18:43:51 2024 +++ src/prefs.c Fri Apr 5 15:32:45 2024 @@ -79,6 +79,7 @@ prefs.middle_click_opens_new_tab = TRUE; prefs.right_click_closes_tab = TRUE; prefs.scroll_switches_tabs = TRUE; + prefs.scroll_switches_tabs_reverse = FALSE; prefs.no_proxy = dStrdup(PREFS_NO_PROXY); prefs.panel_size = P_medium; prefs.parse_embedded_css=TRUE;
--- src/prefs.h Sat Mar 9 18:43:51 2024 +++ src/prefs.h Fri Apr 5 15:33:40 2024 @@ -107,6 +107,7 @@ bool_t middle_click_opens_new_tab; bool_t right_click_closes_tab; bool_t scroll_switches_tabs; + bool_t scroll_switches_tabs_reverse; bool_t search_url_idx; Dlist *search_urls; char *save_dir;
--- src/prefsparser.cc Sat Mar 9 18:43:51 2024 +++ src/prefsparser.cc Fri Apr 5 15:35:19 2024 @@ -192,6 +192,7 @@ 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 }, + { "scroll_switches_tabs_reverse", &prefs.scroll_switches_tabs_reverse, 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 },
--- src/uicmd.cc Sat Mar 9 18:43:51 2024 +++ src/uicmd.cc Fri Apr 5 15:41:30 2024 @@ -254,7 +254,11 @@ int dy = Fl::event_dy(); int dir = dy ? dy : dx;
Wouldn't this be simpler? if (prefs.scroll_switches_tabs_reverse) dir = -dir;
- if (dir > 0) + if (dir > 0 && prefs.scroll_switches_tabs_reverse) + prev_tab(); + else if (dir > 0) + next_tab(); + else if (dir < 0 && prefs.scroll_switches_tabs_reverse) next_tab(); else if (dir < 0) prev_tab();
Thanks for the patch, I will merge it when I have a moment. Rodrigo.