1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-06 04:53:12 +08:00
osu-lazer/osu.Game/Overlays/Chat/ChatOverlayDrawableChannel.cs
Jai Sharma c0aaeff2b3 Update DaySeparator to use new design throughout
Moves `DaySeparator` chat component to it's own file and update it to
match new chat design. Makes use of several virtual attributes that can
be overridden to update spacing and layout in other usage contexts.

Remove redundant usage of `ChatOverlayDaySeparator`, since the new
design is now part of the base class.

Create `StandAloneDaySeparator` to use in `StandAloneChatDisplay` which
overrides attributes to match correct spacing and layout for its design.

Ensure that `DrawableChannel.CreateDaySeparator` returns type of
`DaySeparator` instead of `Drawable`.
2022-06-04 18:02:14 +01:00

40 lines
1.2 KiB
C#

// 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.
#nullable enable
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Online.Chat;
namespace osu.Game.Overlays.Chat
{
public class ChatOverlayDrawableChannel : DrawableChannel
{
public ChatOverlayDrawableChannel(Channel channel)
: base(channel)
{
}
[BackgroundDependencyLoader]
private void load()
{
// TODO: Remove once DrawableChannel & ChatLine padding is fixed
ChatLineFlow.Padding = new MarginPadding(0);
}
protected override DaySeparator CreateDaySeparator(DateTimeOffset time) => new ChatOverlayDaySeparator(time);
private class ChatOverlayDaySeparator : DaySeparator
{
public ChatOverlayDaySeparator(DateTimeOffset time)
: base(time)
{
// TODO: Remove once DrawableChannel & ChatLine padding is fixed
Padding = new MarginPadding { Horizontal = 15 };
}
}
}
}