1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:07:38 +08:00

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;

View File

@ -166,6 +166,8 @@ namespace osu.Game.Overlays
channelTabs.ChannelSelectorActive.ValueChanged += value => channelSelection.State = value ? Visibility.Visible : Visibility.Hidden;
channelSelection.StateChanged += (overlay, state) =>
{
channelTabs.ChannelSelectorActive.Value = state == Visibility.Visible;
if (state == Visibility.Visible)
{
inputTextBox.HoldFocus = false;