mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 21:02:55 +08:00
Make the add tab item unselectable and toggle the channel list
This commit is contained in:
parent
697fab9248
commit
62ada0afcb
@ -23,13 +23,9 @@ namespace osu.Game.Overlays.Chat
|
||||
protected override TabItem<Channel> CreateTabItem(Channel value) => new ChannelTabItem(value);
|
||||
|
||||
private const float shear_width = 10;
|
||||
private readonly Channel addChannel = new Channel { Name = "+" };
|
||||
|
||||
public readonly Bindable<bool> ChannelSelectorActive = new Bindable<bool>();
|
||||
|
||||
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<Channel>
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,6 @@ namespace osu.Game.Overlays
|
||||
else
|
||||
{
|
||||
inputTextBox.HoldFocus = true;
|
||||
channelTabs.Current.Value = channelTabs.LastTab;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user