summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2008-09-26 22:52:12 +0200
committerjcid <devnull@localhost>2008-09-26 22:52:12 +0200
commitc7350148277dee97ae428f031832cb79ca49bfa1 (patch)
treea8647ebcb95934b39e8589423e87eb417b882031 /src
parent60cc0a62eb80b8e642edda06b72c7d0896dac95b (diff)
- Made the history popups use "focus_new_tab" & "middle_click_opens_new_tab"
Diffstat (limited to 'src')
-rw-r--r--src/menu.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/menu.cc b/src/menu.cc
index d8d7480d..113ffad0 100644
--- a/src/menu.cc
+++ b/src/menu.cc
@@ -229,10 +229,17 @@ static void Menu_history_cb(Widget *wid, void *data)
{
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);
}