From 78a8a6490e50a15eb8aad5f83675f1c741e6ea30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20H=C3=BCbner?= Date: Wed, 24 Jul 2019 17:17:29 +0200 Subject: [PATCH] close chat tabs with middle mouse button --- .../Overlays/Chat/Tabs/ChannelSelectorTabItem.cs | 3 +++ osu.Game/Overlays/Chat/Tabs/ChannelTabItem.cs | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/osu.Game/Overlays/Chat/Tabs/ChannelSelectorTabItem.cs b/osu.Game/Overlays/Chat/Tabs/ChannelSelectorTabItem.cs index 7386bffb1a..f6533be551 100644 --- a/osu.Game/Overlays/Chat/Tabs/ChannelSelectorTabItem.cs +++ b/osu.Game/Overlays/Chat/Tabs/ChannelSelectorTabItem.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; +using osu.Framework.Input.Events; using osu.Game.Graphics; using osu.Game.Online.Chat; @@ -39,5 +40,7 @@ public ChannelSelectorTabChannel() Name = "+"; } } + + protected override bool OnMouseUp(MouseUpEvent e) => false; } } diff --git a/osu.Game/Overlays/Chat/Tabs/ChannelTabItem.cs b/osu.Game/Overlays/Chat/Tabs/ChannelTabItem.cs index 7f820e4ff7..859ca30d7f 100644 --- a/osu.Game/Overlays/Chat/Tabs/ChannelTabItem.cs +++ b/osu.Game/Overlays/Chat/Tabs/ChannelTabItem.cs @@ -16,6 +16,7 @@ using osu.Game.Online.Chat; using osuTK; using osuTK.Graphics; +using osuTK.Input; namespace osu.Game.Overlays.Chat.Tabs { @@ -138,6 +139,17 @@ protected override void OnHoverLost(HoverLostEvent e) updateState(); } + protected override bool OnMouseUp(MouseUpEvent e) + { + if (e.Button == MouseButton.Middle) + { + CloseButton.Action(); + return true; + } + + return false; + } + [BackgroundDependencyLoader] private void load(OsuColour colours) {