Fixed style changes and cleaned up ctrl + t implementation

This commit is contained in:
Jess Meng
2020-12-12 15:53:08 -08:00
parent 92cab12eb7
commit 3dd6589d6e
2 changed files with 8 additions and 16 deletions

View File

@ -96,6 +96,11 @@ namespace osu.Game.Overlays.Chat.Tabs
selectorTab.Active.Value = false; selectorTab.Active.Value = false;
} }
public void SelectChannelSelectorTab()
{
SelectTab(selectorTab);
}
protected override TabFillFlowContainer CreateTabFlow() => new ChannelTabFillFlowContainer protected override TabFillFlowContainer CreateTabFlow() => new ChannelTabFillFlowContainer
{ {
Direction = FillDirection.Full, Direction = FillDirection.Full,

View File

@ -25,9 +25,6 @@ using osuTK.Input;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Textures;
using System;
using osu.Game.Input.Bindings;
namespace osu.Game.Overlays namespace osu.Game.Overlays
{ {
public class ChatOverlay : OsuFocusedOverlayContainer, INamedOverlayComponent public class ChatOverlay : OsuFocusedOverlayContainer, INamedOverlayComponent
@ -335,17 +332,6 @@ namespace osu.Game.Overlays
if (channel != null) if (channel != null)
ChannelTabControl.Current.Value = channel; ChannelTabControl.Current.Value = channel;
} }
private void selectChannelSelectorTab()
{
int i = 0;
var channel = ChannelTabControl.Items
.Where(tab => (tab is ChannelSelectorTabItem.ChannelSelectorTabChannel))
.ElementAtOrDefault(i);
if (channel != null)
ChannelTabControl.Current.Value = channel;
}
protected override bool OnKeyDown(KeyDownEvent e) protected override bool OnKeyDown(KeyDownEvent e)
{ {
if (e.AltPressed) if (e.AltPressed)
@ -369,6 +355,7 @@ namespace osu.Game.Overlays
return true; return true;
} }
} }
if (e.ControlPressed) if (e.ControlPressed)
{ {
switch (e.Key) switch (e.Key)
@ -376,8 +363,9 @@ namespace osu.Game.Overlays
case Key.W: case Key.W:
channelManager.LeaveChannel(channelManager.CurrentChannel.Value); channelManager.LeaveChannel(channelManager.CurrentChannel.Value);
return true; return true;
case Key.T: case Key.T:
selectChannelSelectorTab(); ChannelTabControl.SelectChannelSelectorTab();
return true; return true;
} }
} }
@ -417,7 +405,6 @@ namespace osu.Game.Overlays
private void joinedChannelsChanged(object sender, NotifyCollectionChangedEventArgs args) private void joinedChannelsChanged(object sender, NotifyCollectionChangedEventArgs args)
{ {
switch (args.Action) switch (args.Action)
{ {
case NotifyCollectionChangedAction.Add: case NotifyCollectionChangedAction.Add: