mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 00:43:21 +08:00
Reselect the chosen tab when closing the channel list
This commit is contained in:
parent
24b3ec7787
commit
697fab9248
@ -23,9 +23,13 @@ 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 };
|
||||
@ -41,7 +45,12 @@ namespace osu.Game.Overlays.Chat
|
||||
Padding = new MarginPadding(10),
|
||||
});
|
||||
|
||||
AddTabItem(new ChannelTabItem.ChannelSelectorTabItem(new Channel { Name = "+" }, ChannelSelectorActive));
|
||||
AddTabItem(new ChannelTabItem.ChannelSelectorTabItem(addChannel, ChannelSelectorActive));
|
||||
|
||||
Current.ValueChanged += tab =>
|
||||
{
|
||||
if (tab != addChannel) lastTab = tab;
|
||||
};
|
||||
}
|
||||
|
||||
private class ChannelTabItem : TabItem<Channel>
|
||||
|
@ -173,6 +173,7 @@ namespace osu.Game.Overlays
|
||||
else
|
||||
{
|
||||
inputTextBox.HoldFocus = true;
|
||||
channelTabs.Current.Value = channelTabs.LastTab;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user