Update new chat overlay day separator colours and spacing

Updates the `DaySeparator` component to have separately settable colours
for the text and the lines.

Updates existing overrides of the `DaySeparator` to use the new colour
setter.

Create new `ChatOverlayDrawableChannel` with adjusted spacing and new
`DaySeparator` colours.
This commit is contained in:
Jai Sharma
2022-05-06 22:56:35 +01:00
parent 404798395c
commit 9d62206176
5 changed files with 64 additions and 28 deletions

View File

@ -38,7 +38,7 @@ namespace osu.Game.Overlays.Chat
private Container searchIconContainer = null!;
private ChatTextBox chatTextBox = null!;
private const float chatting_text_width = 240;
private const float chatting_text_width = 220;
private const float search_icon_width = 40;
[BackgroundDependencyLoader]

View File

@ -9,6 +9,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
@ -123,8 +124,9 @@ namespace osu.Game.Overlays.Chat
protected virtual DaySeparator CreateDaySeparator(DateTimeOffset time) => new DaySeparator(time)
{
TextColour = colours.ChatBlue.Lighten(0.7f),
LineColour = colours.ChatBlue.Lighten(0.7f),
Margin = new MarginPadding { Vertical = 10 },
Colour = colours.ChatBlue.Lighten(0.7f),
};
private void newMessagesArrived(IEnumerable<Message> newMessages) => Schedule(() =>
@ -212,6 +214,12 @@ namespace osu.Game.Overlays.Chat
set => text.Font = text.Font.With(size: value);
}
public ColourInfo TextColour
{
get => text.Colour;
set => text.Colour = value;
}
private float lineHeight = 2;
public float LineHeight
@ -220,6 +228,14 @@ namespace osu.Game.Overlays.Chat
set => lineHeight = leftBox.Height = rightBox.Height = value;
}
private ColourInfo lineColour;
public ColourInfo LineColour
{
get => lineColour;
set => lineColour = leftBox.Colour = rightBox.Colour = value;
}
private readonly SpriteText text;
private readonly Box leftBox;
private readonly Box rightBox;