Fix Selected tab beeing choosen multiple times

This commit is contained in:
miterosan
2018-04-11 20:27:33 +02:00
parent 3860594f40
commit 697b551f3e
4 changed files with 4 additions and 11 deletions

View File

@ -58,9 +58,6 @@ namespace osu.Game.Overlays.Chat
TabContainer.SetLayoutPosition(selectorTab, float.MaxValue);
base.AddTabItem(item, addToDropdown);
if (SelectedTab == null)
SelectTab(item);
}
protected override TabItem<Channel> CreateTabItem(Channel value) => new ChannelTabItem(value) { OnRequestClose = tabCloseRequested };

View File

@ -79,6 +79,8 @@ namespace osu.Game.Overlays.Chat
ChannelTabControl.AddItem(channel);
break;
}
}
public void RemoveItem(Channel channel)

View File

@ -31,14 +31,6 @@ namespace osu.Game.Overlays.Chat
};
}
protected override void AddTabItem(TabItem<Channel> item, bool addToDropdown = true)
{
base.AddTabItem(item, addToDropdown);
if (SelectedTab == null)
SelectTab(item);
}
private void tabCloseRequested(TabItem<Channel> priv)
{
int totalTabs = TabContainer.Count -1; // account for selectorTab

View File

@ -139,12 +139,14 @@ namespace osu.Game.Overlays.Chat
Text = value.Name,
Margin = new MarginPadding(1),
TextSize = 18,
Alpha = 0,
},
closeButton = new ChatTabItemCloseButton
{
Height = 1,
Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft,
Alpha = 0,
Margin = new MarginPadding
{
Right = 5