From fc9e4f92a1821adeb9b8cd04f0d9cddfe42c28d1 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Mon, 10 Jun 2019 12:05:49 +0200 Subject: Implement Close Other and Close Tab menu items (#319) --- core/tally.vala | 15 +++++++++++++++ ui/menus.ui | 10 ++++++++++ 2 files changed, 25 insertions(+) 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); } diff --git a/ui/menus.ui b/ui/menus.ui index 22d1a750..d89f8349 100644 --- a/ui/menus.ui +++ b/ui/menus.ui @@ -143,5 +143,15 @@ _Duplicate Current Tab +
+ + tally.close-other + Close Ot_her Tabs + + + tally.close-tab + _Close Tab + +
-- cgit v1.2.1