2021-04-28 11:11:29 +08: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.
|
|
|
|
|
|
|
|
using Markdig.Syntax;
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers.Markdown;
|
|
|
|
using osu.Game.Overlays;
|
|
|
|
|
|
|
|
namespace osu.Game.Graphics.Containers.Markdown
|
|
|
|
{
|
|
|
|
public class OsuMarkdownQuoteBlock : MarkdownQuoteBlock
|
|
|
|
{
|
|
|
|
private Drawable background;
|
|
|
|
|
|
|
|
public OsuMarkdownQuoteBlock(QuoteBlock quoteBlock)
|
|
|
|
: base(quoteBlock)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(OverlayColourProvider colourProvider)
|
|
|
|
{
|
|
|
|
background.Colour = colourProvider.Content2;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override Drawable CreateBackground()
|
|
|
|
{
|
2021-05-06 06:35:16 +08:00
|
|
|
background = base.CreateBackground();
|
|
|
|
background.Width = 2;
|
|
|
|
return background;
|
2021-04-28 11:11:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public override MarkdownTextFlowContainer CreateTextFlow()
|
|
|
|
{
|
|
|
|
var textFlow = base.CreateTextFlow();
|
|
|
|
textFlow.Margin = new MarginPadding
|
|
|
|
{
|
|
|
|
Top = 10,
|
|
|
|
Bottom = 10,
|
|
|
|
Left = 20,
|
|
|
|
Right = 20,
|
|
|
|
};
|
|
|
|
return textFlow;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|