2021-04-30 02:43:05 +00:00
|
|
|
// 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.
|
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2021-04-30 03:35:40 +00:00
|
|
|
using osu.Framework.Allocation;
|
2021-04-30 02:43:05 +00:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2021-04-30 03:35:40 +00:00
|
|
|
using osu.Framework.Graphics.Containers.Markdown;
|
2021-05-07 06:19:30 +00:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
2021-04-30 02:43:05 +00:00
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Graphics.Containers.Markdown
|
|
|
|
{
|
2021-05-07 06:19:30 +00:00
|
|
|
public abstract partial class OsuMarkdownListItem : CompositeDrawable
|
2021-04-30 02:43:05 +00:00
|
|
|
{
|
2021-04-30 03:35:40 +00:00
|
|
|
[Resolved]
|
|
|
|
private IMarkdownTextComponent parentTextComponent { get; set; }
|
|
|
|
|
2021-05-07 06:19:30 +00:00
|
|
|
public FillFlowContainer Content { get; private set; }
|
2021-04-30 03:12:43 +00:00
|
|
|
|
2021-05-07 06:19:30 +00:00
|
|
|
protected OsuMarkdownListItem()
|
2021-04-30 02:43:05 +00:00
|
|
|
{
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
RelativeSizeAxes = Axes.X;
|
2021-05-07 06:19:30 +00:00
|
|
|
}
|
2021-04-30 03:12:43 +00:00
|
|
|
|
2021-05-07 06:19:30 +00:00
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
2021-04-30 03:12:43 +00:00
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
{
|
2021-05-07 06:19:30 +00:00
|
|
|
CreateMarker(),
|
2021-04-30 03:12:43 +00:00
|
|
|
Content = new FillFlowContainer
|
|
|
|
{
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
Spacing = new Vector2(10, 10),
|
|
|
|
}
|
|
|
|
};
|
2021-04-30 02:43:05 +00:00
|
|
|
}
|
2021-04-30 03:35:40 +00:00
|
|
|
|
2021-05-07 06:19:30 +00:00
|
|
|
protected virtual SpriteText CreateMarker() => parentTextComponent.CreateSpriteText();
|
2021-04-30 02:43:05 +00:00
|
|
|
}
|
|
|
|
}
|