mirror of
https://github.com/ppy/osu
synced 2025-01-03 04:42:10 +00:00
add bullet marker in OsuMarkdownListItem
This commit is contained in:
parent
010c51e6ed
commit
e3cc4561ab
@ -1,8 +1,10 @@
|
||||
// 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.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Containers.Markdown;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Graphics.Containers.Markdown
|
||||
@ -11,6 +13,9 @@ namespace osu.Game.Graphics.Containers.Markdown
|
||||
{
|
||||
private const float default_left_padding = 20;
|
||||
|
||||
[Resolved]
|
||||
private IMarkdownTextComponent parentTextComponent { get; set; }
|
||||
|
||||
public FillFlowContainer Content { get; }
|
||||
|
||||
public OsuMarkdownListItem()
|
||||
@ -30,5 +35,18 @@ namespace osu.Game.Graphics.Containers.Markdown
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
var marker = parentTextComponent.CreateSpriteText();
|
||||
marker.Text = "●";
|
||||
marker.Font = OsuFont.GetFont(size: marker.Font.Size / 2);
|
||||
marker.Origin = Anchor.Centre;
|
||||
marker.X = -default_left_padding / 2;
|
||||
marker.Y = marker.Font.Size;
|
||||
|
||||
AddInternal(marker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user