osu/osu.Game/Graphics/Containers/Markdown/OsuMarkdownListItem.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.3 KiB
C#
Raw Permalink Normal View History

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
using osu.Framework.Allocation;
2021-04-30 02:43:05 +00:00
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Containers.Markdown;
using osu.Framework.Graphics.Sprites;
2021-04-30 02:43:05 +00:00
using osuTK;
namespace osu.Game.Graphics.Containers.Markdown
{
public abstract partial class OsuMarkdownListItem : CompositeDrawable
2021-04-30 02:43:05 +00:00
{
[Resolved]
private IMarkdownTextComponent parentTextComponent { get; set; }
public FillFlowContainer Content { get; private set; }
protected OsuMarkdownListItem()
2021-04-30 02:43:05 +00:00
{
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;
}
[BackgroundDependencyLoader]
private void load()
{
InternalChildren = new Drawable[]
{
CreateMarker(),
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
}
protected virtual SpriteText CreateMarker() => parentTextComponent.CreateSpriteText();
2021-04-30 02:43:05 +00:00
}
}