mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 01:37:46 +08:00
Move tab channel class into tab item class
This commit is contained in:
parent
8957ad5a7e
commit
7adaa09263
@ -93,7 +93,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
AddUntilStep("remove all channels", () =>
|
AddUntilStep("remove all channels", () =>
|
||||||
{
|
{
|
||||||
var first = channelTabControl.Items.First();
|
var first = channelTabControl.Items.First();
|
||||||
if (first is ChannelSelectorTabChannel)
|
if (first is ChannelSelectorTabItem.ChannelSelectorTabChannel)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
channelTabControl.RemoveChannel(first);
|
channelTabControl.RemoveChannel(first);
|
||||||
|
@ -87,7 +87,7 @@ namespace osu.Game.Online.Chat
|
|||||||
|
|
||||||
private void currentChannelChanged(ValueChangedEvent<Channel> e)
|
private void currentChannelChanged(ValueChangedEvent<Channel> e)
|
||||||
{
|
{
|
||||||
if (!(e.NewValue is ChannelSelectorTabChannel))
|
if (!(e.NewValue is ChannelSelectorTabItem.ChannelSelectorTabChannel))
|
||||||
JoinChannel(e.NewValue);
|
JoinChannel(e.NewValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
|
||||||
|
|
||||||
using osu.Game.Online.Chat;
|
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Chat.Tabs
|
|
||||||
{
|
|
||||||
public class ChannelSelectorTabChannel : Channel
|
|
||||||
{
|
|
||||||
public ChannelSelectorTabChannel()
|
|
||||||
{
|
|
||||||
Name = "+";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -31,5 +31,13 @@ namespace osu.Game.Overlays.Chat.Tabs
|
|||||||
BackgroundInactive = colour.Gray2;
|
BackgroundInactive = colour.Gray2;
|
||||||
BackgroundActive = colour.Gray3;
|
BackgroundActive = colour.Gray3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ChannelSelectorTabChannel : Channel
|
||||||
|
{
|
||||||
|
public ChannelSelectorTabChannel()
|
||||||
|
{
|
||||||
|
Name = "+";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ namespace osu.Game.Overlays
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.NewValue is ChannelSelectorTabChannel)
|
if (e.NewValue is ChannelSelectorTabItem.ChannelSelectorTabChannel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
textbox.Current.Disabled = e.NewValue.ReadOnly;
|
textbox.Current.Disabled = e.NewValue.ReadOnly;
|
||||||
@ -271,7 +271,7 @@ namespace osu.Game.Overlays
|
|||||||
private void selectTab(int index)
|
private void selectTab(int index)
|
||||||
{
|
{
|
||||||
var channel = channelTabControl.Items.Skip(index).FirstOrDefault();
|
var channel = channelTabControl.Items.Skip(index).FirstOrDefault();
|
||||||
if (channel != null && !(channel is ChannelSelectorTabChannel))
|
if (channel != null && !(channel is ChannelSelectorTabItem.ChannelSelectorTabChannel))
|
||||||
channelTabControl.Current.Value = channel;
|
channelTabControl.Current.Value = channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user