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

Simplify action

This commit is contained in:
Dean Herbert 2017-09-06 22:58:21 +09:00
parent a7fa66b9f9
commit 4f49a0c183

View File

@ -62,13 +62,7 @@ namespace osu.Game.Overlays.Chat
SelectTab(item);
}
protected override TabItem<Channel> CreateTabItem(Channel value)
{
ChannelTabItem tab = new ChannelTabItem(value);
tab.OnRequestClose = () => onTabClose(tab);
return tab;
}
protected override TabItem<Channel> CreateTabItem(Channel value) => new ChannelTabItem(value) { OnRequestClose = onTabClose };
protected override void SelectTab(TabItem<Channel> tab)
{
@ -113,7 +107,7 @@ namespace osu.Game.Overlays.Chat
private readonly Box highlightBox;
private readonly SpriteIcon icon;
public Action OnRequestClose;
public Action<ChannelTabItem> OnRequestClose;
private void updateState()
{
@ -257,7 +251,7 @@ namespace osu.Game.Overlays.Chat
Anchor = Anchor.CentreRight,
Action = delegate
{
if (IsRemovable) OnRequestClose?.Invoke();
if (IsRemovable) OnRequestClose?.Invoke(this);
},
},
},