diff options
author | Christian Dywan <christian@twotoasts.de> | 2019-06-10 12:05:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-10 12:05:49 +0200 |
commit | fc9e4f92a1821adeb9b8cd04f0d9cddfe42c28d1 (patch) | |
tree | 5fae9a19d08dbf8469b8acab14a0bbcd90d924d0 /core | |
parent | 8291366d543fe224550debcb43800df96aecc7ab (diff) | |
download | midori-git-fc9e4f92a1821adeb9b8cd04f0d9cddfe42c28d1.tar.gz |
Implement Close Other and Close Tab menu items (#319)
Diffstat (limited to 'core')
-rw-r--r-- | core/tally.vala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/tally.vala b/core/tally.vala index 1fdc65df..a5f70aeb 100644 --- a/core/tally.vala +++ b/core/tally.vala @@ -145,6 +145,21 @@ namespace Midori { browser.add (new Tab (null, tab.web_context, uri)); }); group.add_action (action); + action = new SimpleAction ("close-other", null); + action.activate.connect (() => { + var browser = (Browser)tab.get_ancestor (typeof (Browser)); + foreach (var widget in browser.tabs.get_children ()) { + if (widget != tab) { + ((Tab)widget).try_close (); + } + } + }); + group.add_action (action); + action = new SimpleAction ("close-tab", null); + action.activate.connect (() => { + tab.try_close (); + }); + group.add_action (action); insert_action_group ("tally", group); } |