From 46f2db1712beda4ae0a33d2c5fe54b6b10f19b0a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 10 Mar 2022 15:58:19 +0900 Subject: [PATCH] Move `ChannelListingItem` spacing into item so input is always handled by an item in the list Without this change, there would be a couple of pixels between each list item where nothing would be hovered. This is a pretty annoying UX which we should be avoiding we possible. --- osu.Game/Overlays/Chat/Listing/ChannelListing.cs | 2 -- osu.Game/Overlays/Chat/Listing/ChannelListingItem.cs | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Chat/Listing/ChannelListing.cs b/osu.Game/Overlays/Chat/Listing/ChannelListing.cs index 9b8b45c85f..732c78de15 100644 --- a/osu.Game/Overlays/Chat/Listing/ChannelListing.cs +++ b/osu.Game/Overlays/Chat/Listing/ChannelListing.cs @@ -12,7 +12,6 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics.Containers; using osu.Game.Online.Chat; -using osuTK; namespace osu.Game.Overlays.Chat.Listing { @@ -51,7 +50,6 @@ private void load() Direction = FillDirection.Vertical, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, - Spacing = new Vector2(3), Padding = new MarginPadding { Vertical = 13, diff --git a/osu.Game/Overlays/Chat/Listing/ChannelListingItem.cs b/osu.Game/Overlays/Chat/Listing/ChannelListingItem.cs index 83362bc79d..526cbcda87 100644 --- a/osu.Game/Overlays/Chat/Listing/ChannelListingItem.cs +++ b/osu.Game/Overlays/Chat/Listing/ChannelListingItem.cs @@ -43,6 +43,8 @@ public class ChannelListingItem : OsuClickableContainer, IFilterable private const float text_size = 18; private const float icon_size = 14; + private const float vertical_margin = 1.5f; + public ChannelListingItem(Channel channel) { this.channel = channel; @@ -54,7 +56,7 @@ private void load() Masking = true; CornerRadius = 5; RelativeSizeAxes = Axes.X; - Height = 20; + Height = 20 + (vertical_margin * 2); Children = new Drawable[] { @@ -62,6 +64,7 @@ private void load() { RelativeSizeAxes = Axes.Both, Colour = colourProvider.Background3, + Margin = new MarginPadding { Vertical = vertical_margin }, Alpha = 0f, }, new GridContainer