mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 21:07:33 +08:00
extract out table head and body border into separate component
This commit is contained in:
parent
64e9c5e9ba
commit
d92e593ddd
@ -26,27 +26,10 @@ namespace osu.Game.Graphics.Containers.Markdown
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
{
|
||||
var border = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
};
|
||||
|
||||
if (isHeading)
|
||||
{
|
||||
border.Colour = colourProvider.Background3;
|
||||
border.Height = 2;
|
||||
border.Anchor = Anchor.BottomLeft;
|
||||
border.Origin = Anchor.BottomLeft;
|
||||
}
|
||||
AddInternal(new TableHeadBorder());
|
||||
else
|
||||
{
|
||||
border.Colour = colourProvider.Background4;
|
||||
border.Height = 1;
|
||||
border.Anchor = Anchor.TopLeft;
|
||||
border.Origin = Anchor.TopLeft;
|
||||
}
|
||||
|
||||
AddInternal(border);
|
||||
AddInternal(new TableBodyBorder());
|
||||
}
|
||||
|
||||
public override MarkdownTextFlowContainer CreateTextFlow() => new TableCellTextFlowContainer
|
||||
@ -55,6 +38,30 @@ namespace osu.Game.Graphics.Containers.Markdown
|
||||
Padding = new MarginPadding(10),
|
||||
};
|
||||
|
||||
private class TableHeadBorder : Box
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
{
|
||||
Colour = colourProvider.Background3;
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Height = 2;
|
||||
Anchor = Anchor.BottomLeft;
|
||||
Origin = Anchor.BottomLeft;
|
||||
}
|
||||
}
|
||||
|
||||
private class TableBodyBorder : Box
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
{
|
||||
Colour = colourProvider.Background4;
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Height = 1;
|
||||
}
|
||||
}
|
||||
|
||||
private class TableCellTextFlowContainer : OsuMarkdownTextFlowContainer
|
||||
{
|
||||
public FontWeight Weight { get; set; }
|
||||
|
Loading…
Reference in New Issue
Block a user