changeset 353:7217a61abc90

- Made the history popups use "focus_new_tab" & "middle_click_opens_new_tab"
author jcid
date Fri, 26 Sep 2008 22:52:12 +0200
parents 44a801a15c88
children 975f72012a36
files src/menu.cc
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/menu.cc	Fri Sep 26 21:07:49 2008 +0200
+++ b/src/menu.cc	Fri Sep 26 22:52:12 2008 +0200
@@ -229,10 +229,17 @@
 {
    int mb = ((CustItem*)wid)->button();
    int offset = history_direction * VOIDP2INT(data);
+   DilloUrl *url = a_History_get_url(history_list[VOIDP2INT(data)-1]);
 
    if (mb == 2) {
-      /* middle button, open in a new window */
-      a_UIcmd_nav_jump(popup_bw, offset, 1);
+      // Middle button, open in a new window/tab
+      if (prefs.middle_click_opens_new_tab) {
+         int focus = prefs.focus_new_tab ? 1 : 0;
+         if (event_state(SHIFT)) focus = !focus;
+         a_UIcmd_open_url_nt(popup_bw, url, focus);
+      } else {
+         a_UIcmd_open_url_nw(popup_bw, url);
+      }
    } else {
       a_UIcmd_nav_jump(popup_bw, offset, 0);
    }