changeset 1991:a204cc949c1a

Set middle click as default for close tab (+ right_click_closes_tab in dillorc)
author Jorge Arellano Cid <jcid@dillo.org>
date Fri, 29 Apr 2011 12:30:39 -0300
parents 617bb6ada10d
children 75b1b909ffbc
files dillorc src/prefs.c src/prefs.h src/prefsparser.cc src/uicmd.cc
diffstat 5 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dillorc	Fri Apr 29 04:11:46 2011 +0000
+++ b/dillorc	Fri Apr 29 12:30:39 2011 -0300
@@ -228,6 +228,10 @@
 # If you prefer to open a new Window instead, set it to NO.
 #middle_click_opens_new_tab=YES
 
+# A mouse's middle click over a tab closes the Tab.
+# With mousewheel mouses, right click feels way better (set to YES).
+#right_click_closes_tab=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.
--- a/src/prefs.c	Fri Apr 29 04:11:46 2011 +0000
+++ b/src/prefs.c	Fri Apr 29 12:30:39 2011 -0300
@@ -70,6 +70,7 @@
    prefs.load_stylesheets=TRUE;
    prefs.middle_click_drags_page = TRUE;
    prefs.middle_click_opens_new_tab = TRUE;
+   prefs.right_click_closes_tab = FALSE;
    prefs.no_proxy = dStrdup(PREFS_NO_PROXY);
    prefs.panel_size = P_medium;
    prefs.parse_embedded_css=TRUE;
--- a/src/prefs.h	Fri Apr 29 04:11:46 2011 +0000
+++ b/src/prefs.h	Fri Apr 29 12:30:39 2011 -0300
@@ -84,6 +84,7 @@
    char *font_monospace;
    bool_t enterpress_forces_submit;
    bool_t middle_click_opens_new_tab;
+   bool_t right_click_closes_tab;
    char *search_url;
    char *save_dir;
    bool_t show_msg;
--- a/src/prefsparser.cc	Fri Apr 29 04:11:46 2011 +0000
+++ b/src/prefsparser.cc	Fri Apr 29 12:30:39 2011 -0300
@@ -81,6 +81,7 @@
         PREFS_BOOL },
       { "middle_click_opens_new_tab", &prefs.middle_click_opens_new_tab,
         PREFS_BOOL },
+      { "right_click_closes_tab", &prefs.right_click_closes_tab, PREFS_BOOL },
       { "no_proxy", &prefs.no_proxy, PREFS_STRING },
       { "panel_size", &prefs.panel_size, PREFS_PANEL_SIZE },
       { "parse_embedded_css", &prefs.parse_embedded_css, PREFS_BOOL },
--- a/src/uicmd.cc	Fri Apr 29 04:11:46 2011 +0000
+++ b/src/uicmd.cc	Fri Apr 29 12:30:39 2011 -0300
@@ -125,7 +125,8 @@
 
    if (b == FL_LEFT_MOUSE) {
       tabs->switch_tab(btn);
-   } else if (b == FL_RIGHT_MOUSE) {
+   } else if ((b == FL_RIGHT_MOUSE && prefs.right_click_closes_tab) ||
+              (b == FL_MIDDLE_MOUSE && !prefs.right_click_closes_tab)) {
       // TODO: just an example, not necessarily final
       a_UIcmd_close_bw(a_UIcmd_get_bw_by_widget(btn->ui()));
    }