mirror of
https://github.com/ppy/osu.git
synced 2026-05-18 07:09:53 +08:00
6959f2a8cc
Reference : https://github.com/ppy/osu-web/blob/d56352aeefc412507c3dab7c16e3e3118421b436/resources/assets/less/bem/osu-md.less#L41-L45
45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
// 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.Framework.Graphics.Shapes;
|
|
using osu.Game.Overlays;
|
|
|
|
namespace osu.Game.Graphics.Containers.Markdown
|
|
{
|
|
public class OsuMarkdownFencedCodeBlock : MarkdownFencedCodeBlock
|
|
{
|
|
private Box background;
|
|
private MarkdownTextFlowContainer textFlow;
|
|
|
|
public OsuMarkdownFencedCodeBlock(FencedCodeBlock fencedCodeBlock)
|
|
: base(fencedCodeBlock)
|
|
{
|
|
}
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load(OverlayColourProvider colourProvider)
|
|
{
|
|
// TODO : Change to monospace font to match with osu-web
|
|
background.Colour = colourProvider.Background6;
|
|
textFlow.Colour = colourProvider.Light1;
|
|
}
|
|
|
|
protected override Drawable CreateBackground()
|
|
{
|
|
return background = new Box
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
};
|
|
}
|
|
|
|
public override MarkdownTextFlowContainer CreateTextFlow()
|
|
{
|
|
return textFlow = base.CreateTextFlow();
|
|
}
|
|
}
|
|
}
|