// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osuTK.Graphics; namespace osu.Game.Screens.OnlinePlay.Lounge.Components { /// /// Displays contents in a "pill". /// public class PillContainer : Container { private const float padding = 8; public readonly Drawable Background; protected override Container Content { get; } = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.Both, }; public PillContainer() { AutoSizeAxes = Axes.X; Height = 16; InternalChild = new CircularContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.X, RelativeSizeAxes = Axes.Y, Masking = true, Children = new[] { Background = new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, Alpha = 0.5f }, new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.Both, Padding = new MarginPadding { Horizontal = padding }, Child = new GridContainer { AutoSizeAxes = Axes.Both, ColumnDimensions = new[] { new Dimension(GridSizeMode.AutoSize, minSize: 80 - 2 * padding) }, Content = new[] { new[] { Content } } } } } }; } } }