mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 23:53:51 +09:00
add WikiArticlePage
This commit is contained in:
54
osu.Game/Overlays/Wiki/WikiArticlePage.cs
Normal file
54
osu.Game/Overlays/Wiki/WikiArticlePage.cs
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
// 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 osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Overlays.Wiki.Markdown;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.Wiki
|
||||||
|
{
|
||||||
|
public class WikiArticlePage : GridContainer
|
||||||
|
{
|
||||||
|
public Container SidebarContainer { get; }
|
||||||
|
|
||||||
|
public WikiArticlePage(string currentPath, string markdown)
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
RowDimensions = new[]
|
||||||
|
{
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
|
};
|
||||||
|
ColumnDimensions = new[]
|
||||||
|
{
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
|
new Dimension(),
|
||||||
|
};
|
||||||
|
Content = new[]
|
||||||
|
{
|
||||||
|
new Drawable[]
|
||||||
|
{
|
||||||
|
SidebarContainer = new Container
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.X,
|
||||||
|
Child = new WikiSidebar(),
|
||||||
|
},
|
||||||
|
new WikiMarkdownContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
CurrentPath = currentPath,
|
||||||
|
Text = markdown,
|
||||||
|
DocumentMargin = new MarginPadding(0),
|
||||||
|
DocumentPadding = new MarginPadding
|
||||||
|
{
|
||||||
|
Vertical = 20,
|
||||||
|
Left = 30,
|
||||||
|
Right = 50,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user