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