From 62ada0afcb214e68e1b35b31df38cce30cb26d00 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Thu, 1 Jun 2017 20:46:18 -0300 Subject: [PATCH] Make the add tab item unselectable and toggle the channel list --- osu.Game/Overlays/Chat/ChatTabControl.cs | 17 ++++------------- osu.Game/Overlays/ChatOverlay.cs | 1 - 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChatTabControl.cs b/osu.Game/Overlays/Chat/ChatTabControl.cs index 87222f03f9..ba36fce33e 100644 --- a/osu.Game/Overlays/Chat/ChatTabControl.cs +++ b/osu.Game/Overlays/Chat/ChatTabControl.cs @@ -23,13 +23,9 @@ namespace osu.Game.Overlays.Chat protected override TabItem CreateTabItem(Channel value) => new ChannelTabItem(value); private const float shear_width = 10; - private readonly Channel addChannel = new Channel { Name = "+" }; public readonly Bindable ChannelSelectorActive = new Bindable(); - private Channel lastTab; - public Channel LastTab => lastTab; - public ChatTabControl() { TabContainer.Margin = new MarginPadding { Left = 50 }; @@ -45,12 +41,7 @@ namespace osu.Game.Overlays.Chat Padding = new MarginPadding(10), }); - AddTabItem(new ChannelTabItem.ChannelSelectorTabItem(addChannel, ChannelSelectorActive)); - - Current.ValueChanged += tab => - { - if (tab != addChannel) lastTab = tab; - }; + AddTabItem(new ChannelTabItem.ChannelSelectorTabItem(new Channel { Name = "+" }, ChannelSelectorActive)); } private class ChannelTabItem : TabItem @@ -216,11 +207,11 @@ namespace osu.Game.Overlays.Chat { public override bool Active { - get { return base.Active; } + get { return false; } set { - activeBindable.Value = value; - base.Active = value; + activeBindable.Value = !activeBindable.Value; + base.Active = false; } } diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 62ede00bb6..df02b903bf 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -173,7 +173,6 @@ namespace osu.Game.Overlays else { inputTextBox.HoldFocus = true; - channelTabs.Current.Value = channelTabs.LastTab; } }; }