Fix toggle not toggling on pressing escape

Also add comment about hacky implementation of toggle tab.
This commit is contained in:
Dean Herbert
2017-06-05 18:04:40 +09:00
parent 778865b6eb
commit 16fcfc473d
2 changed files with 8 additions and 1 deletions

View File

@ -210,8 +210,10 @@ namespace osu.Game.Overlays.Chat
get { return false; }
set
{
// we basically never want this tab to become active.
// this allows us to become a "toggle" tab.
// is a bit hacky, to say the least.
activeBindable.Value = !activeBindable.Value;
selectorUpdateState();
base.Active = false;
}
}
@ -221,6 +223,9 @@ namespace osu.Game.Overlays.Chat
public ChannelSelectorTabItem(Channel value, Bindable<bool> active) : base(value)
{
activeBindable = active;
activeBindable.ValueChanged += v => selectorUpdateState();
Depth = float.MaxValue;
Width = 45;