diff options
author | jcid <devnull@localhost> | 2008-07-12 19:29:56 +0200 |
---|---|---|
committer | jcid <devnull@localhost> | 2008-07-12 19:29:56 +0200 |
commit | addc25b3b4bc19ddfe99e844df7fb3ac38c5866c (patch) | |
tree | 7b56ed7cfb3f34cddb9c99652306c5b065cecded /src | |
parent | 737524c2c3c4eb5dd569e82675a3331a407fb839 (diff) |
- Made navigation history popup menus react to middle click into a new window.
Diffstat (limited to 'src')
-rw-r--r-- | src/menu.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/menu.cc b/src/menu.cc index 3069c3b8..8f5f8124 100644 --- a/src/menu.cc +++ b/src/menu.cc @@ -45,14 +45,20 @@ static int history_direction = -1; static int *history_list = NULL; /* - * Local sub class - * (Used to add the hint for history popup menus) + * Local sub class. + * Used to add the hint for history popup menus, and to remember + * the mouse button pressed over a menu item. */ - class NewItem : public Item { + int EventButton; public: - NewItem (const char* label) : Item(label) {}; + NewItem (const char* label) : Item(label) { EventButton = 0; }; + int button () { return EventButton; }; void draw(); + int handle(int e) { + EventButton = event_button(); + return Item::handle(e); + } }; /* @@ -211,10 +217,10 @@ static void Menu_bugmeter_about_cb(Widget* ) */ static void Menu_history_cb(Widget *wid, void *data) { - int k = event_button(); + int mb = ((NewItem*)wid)->button(); int offset = history_direction * VOIDP2INT(data); - if (k == 2) { + if (mb == 2) { /* middle button, open in a new window */ a_UIcmd_nav_jump(popup_bw, offset, 1); } else { |