mirror of
https://github.com/osukey/osukey.git
synced 2025-06-30 07:38:04 +09:00
Ensure channel traversal shortcut scrolls channel list item into view
This commit is contained in:
parent
4a36f3aa4c
commit
cd90d29315
@ -29,6 +29,7 @@ namespace osu.Game.Overlays.Chat.ChannelList
|
|||||||
|
|
||||||
private readonly Dictionary<Channel, ChannelListItem> channelMap = new Dictionary<Channel, ChannelListItem>();
|
private readonly Dictionary<Channel, ChannelListItem> channelMap = new Dictionary<Channel, ChannelListItem>();
|
||||||
|
|
||||||
|
private OsuScrollContainer scroll = null!;
|
||||||
private ChannelListItemFlow publicChannelFlow = null!;
|
private ChannelListItemFlow publicChannelFlow = null!;
|
||||||
private ChannelListItemFlow privateChannelFlow = null!;
|
private ChannelListItemFlow privateChannelFlow = null!;
|
||||||
private ChannelListItem selector = null!;
|
private ChannelListItem selector = null!;
|
||||||
@ -43,7 +44,7 @@ namespace osu.Game.Overlays.Chat.ChannelList
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = colourProvider.Background6,
|
Colour = colourProvider.Background6,
|
||||||
},
|
},
|
||||||
new OsuScrollContainer
|
scroll = new OsuScrollContainer
|
||||||
{
|
{
|
||||||
Padding = new MarginPadding { Vertical = 7 },
|
Padding = new MarginPadding { Vertical = 7 },
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -104,6 +105,8 @@ namespace osu.Game.Overlays.Chat.ChannelList
|
|||||||
return channelMap[channel];
|
return channelMap[channel];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ScrollChannelIntoView(Channel channel) => scroll.ScrollIntoView(this.GetItem(channel));
|
||||||
|
|
||||||
private ChannelListItemFlow getFlowForChannel(Channel channel)
|
private ChannelListItemFlow getFlowForChannel(Channel channel)
|
||||||
{
|
{
|
||||||
switch (channel.Type)
|
switch (channel.Type)
|
||||||
|
@ -397,6 +397,8 @@ namespace osu.Game.Overlays
|
|||||||
int currentIndex = overlayChannels.IndexOf(currentChannel.Value);
|
int currentIndex = overlayChannels.IndexOf(currentChannel.Value);
|
||||||
|
|
||||||
currentChannel.Value = overlayChannels[(currentIndex + direction + overlayChannels.Count) % overlayChannels.Count];
|
currentChannel.Value = overlayChannels[(currentIndex + direction + overlayChannels.Count) % overlayChannels.Count];
|
||||||
|
|
||||||
|
channelList.ScrollChannelIntoView(currentChannel.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<Channel> filterToChatChannels(IEnumerable channels)
|
private IEnumerable<Channel> filterToChatChannels(IEnumerable channels)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user