1
0
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:
DrabWeb 2017-06-01 20:22:09 -03:00
parent 24b3ec7787
commit 697fab9248
2 changed files with 11 additions and 1 deletions

View File

@ -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>

View File

@ -173,6 +173,7 @@ namespace osu.Game.Overlays
else
{
inputTextBox.HoldFocus = true;
channelTabs.Current.Value = channelTabs.LastTab;
}
};
}