mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
create OsuMarkdownImage
This commit is contained in:
20
osu.Game/Graphics/Containers/Markdown/OsuMarkdownImage.cs
Normal file
20
osu.Game/Graphics/Containers/Markdown/OsuMarkdownImage.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// 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.Inlines;
|
||||||
|
using osu.Framework.Graphics.Containers.Markdown;
|
||||||
|
using osu.Framework.Graphics.Cursor;
|
||||||
|
|
||||||
|
namespace osu.Game.Graphics.Containers.Markdown
|
||||||
|
{
|
||||||
|
public class OsuMarkdownImage : MarkdownImage, IHasTooltip
|
||||||
|
{
|
||||||
|
public string TooltipText { get; }
|
||||||
|
|
||||||
|
public OsuMarkdownImage(LinkInline linkInline)
|
||||||
|
: base(linkInline.Url)
|
||||||
|
{
|
||||||
|
TooltipText = linkInline.Title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -17,6 +17,8 @@ namespace osu.Game.Graphics.Containers.Markdown
|
|||||||
protected override void AddLinkText(string text, LinkInline linkInline)
|
protected override void AddLinkText(string text, LinkInline linkInline)
|
||||||
=> AddDrawable(new OsuMarkdownLinkText(text, linkInline));
|
=> AddDrawable(new OsuMarkdownLinkText(text, linkInline));
|
||||||
|
|
||||||
|
protected override void AddImage(LinkInline linkInline) => AddDrawable(new OsuMarkdownImage(linkInline));
|
||||||
|
|
||||||
// TODO : Change font to monospace
|
// TODO : Change font to monospace
|
||||||
protected override void AddCodeInLine(CodeInline codeInline) => AddDrawable(new OsuMarkdownInlineCode
|
protected override void AddCodeInLine(CodeInline codeInline) => AddDrawable(new OsuMarkdownInlineCode
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user