1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 03:22:55 +08:00
osu-lazer/osu.Game/Overlays/Chat/ChatOverlayTopBar.cs
Jai Sharma de393f735f Implement basic layout and behaviour of new chat overlay
Provides initial implementation of new chat overlay in component
`ChatOverlayV2`. Contains only the basic functionality required for
a functioning chat overlay according to the new design with the intent
of added the rest of the functionality in subsequent PRs.

Backports existing tests for the current chat overlay except for ones
testing keyboard shortcuts (since they haven't been added) and tab
closing behaviour (since no tabs).
2022-04-30 23:59:47 +01:00

68 lines
2.3 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 osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osuTK;
namespace osu.Game.Overlays.Chat
{
public class ChatOverlayTopBar : Container
{
// IsHovered is used by overlay
public override bool HandlePositionalInput => true;
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider, TextureStore textures)
{
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background3,
},
new GridContainer
{
RelativeSizeAxes = Axes.Both,
ColumnDimensions = new[]
{
new Dimension(GridSizeMode.Absolute, 50),
new Dimension(),
},
Content = new[]
{
new Drawable[]
{
new Sprite
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Texture = textures.Get("Icons/Hexacons/messaging"),
Size = new Vector2(18),
},
// Placeholder text
new OsuSpriteText
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Text = "osu!chat",
Font = OsuFont.Torus.With(size: 16, weight: FontWeight.SemiBold),
Margin = new MarginPadding { Bottom = 2f },
},
},
},
},
};
}
}
}