mirror of https://github.com/ppy/osu
add level in OsuMarkdownListItem
This commit is contained in:
parent
e3cc4561ab
commit
f676526cf4
|
@ -23,7 +23,7 @@ protected override void AddMarkdownComponent(IMarkdownObject markdownObject, Fil
|
|||
break;
|
||||
|
||||
case ListItemBlock listItemBlock:
|
||||
var childContainer = CreateListItem(listItemBlock);
|
||||
var childContainer = CreateListItem(listItemBlock, level);
|
||||
container.Add(childContainer);
|
||||
foreach (var single in listItemBlock)
|
||||
base.AddMarkdownComponent(single, childContainer.Content, level);
|
||||
|
@ -50,7 +50,7 @@ protected override void AddMarkdownComponent(IMarkdownObject markdownObject, Fil
|
|||
Padding = new MarginPadding(0)
|
||||
};
|
||||
|
||||
protected virtual OsuMarkdownListItem CreateListItem(ListItemBlock listItemBlock) => new OsuMarkdownListItem();
|
||||
protected virtual OsuMarkdownListItem CreateListItem(ListItemBlock listItemBlock, int level) => new OsuMarkdownListItem(level);
|
||||
|
||||
protected override MarkdownPipeline CreateBuilder()
|
||||
=> new MarkdownPipelineBuilder().UseAutoIdentifiers(AutoIdentifierOptions.GitHub)
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace osu.Game.Graphics.Containers.Markdown
|
|||
{
|
||||
public class OsuMarkdownListItem : CompositeDrawable
|
||||
{
|
||||
private readonly int level;
|
||||
private const float default_left_padding = 20;
|
||||
|
||||
[Resolved]
|
||||
|
@ -18,8 +19,10 @@ public class OsuMarkdownListItem : CompositeDrawable
|
|||
|
||||
public FillFlowContainer Content { get; }
|
||||
|
||||
public OsuMarkdownListItem()
|
||||
public OsuMarkdownListItem(int level)
|
||||
{
|
||||
this.level = level;
|
||||
|
||||
AutoSizeAxes = Axes.Y;
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Padding = new MarginPadding { Left = default_left_padding };
|
||||
|
|
Loading…
Reference in New Issue