mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Move text and isFullWidth
parameters to constructor
This commit is contained in:
@ -23,12 +23,15 @@ namespace osu.Game.Overlays.Wiki
|
||||
{
|
||||
private WikiPanelMarkdownContainer panelContainer;
|
||||
|
||||
public string Text;
|
||||
private readonly string text;
|
||||
|
||||
public bool IsFullWidth;
|
||||
private readonly bool isFullWidth;
|
||||
|
||||
public WikiPanelContainer()
|
||||
public WikiPanelContainer(string text, bool isFullWidth = false)
|
||||
{
|
||||
this.text = text;
|
||||
this.isFullWidth = isFullWidth;
|
||||
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Padding = new MarginPadding(3);
|
||||
}
|
||||
@ -56,12 +59,11 @@ namespace osu.Game.Overlays.Wiki
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
},
|
||||
panelContainer = new WikiPanelMarkdownContainer
|
||||
panelContainer = new WikiPanelMarkdownContainer(isFullWidth)
|
||||
{
|
||||
Text = Text,
|
||||
Text = text,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
IsFullWidth = IsFullWidth,
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -74,10 +76,12 @@ namespace osu.Game.Overlays.Wiki
|
||||
|
||||
private class WikiPanelMarkdownContainer : WikiMarkdownContainer
|
||||
{
|
||||
public bool IsFullWidth;
|
||||
private readonly bool isFullWidth;
|
||||
|
||||
public WikiPanelMarkdownContainer()
|
||||
public WikiPanelMarkdownContainer(bool isFullWidth)
|
||||
{
|
||||
this.isFullWidth = isFullWidth;
|
||||
|
||||
LineSpacing = 0;
|
||||
DocumentPadding = new MarginPadding(30);
|
||||
DocumentMargin = new MarginPadding(0);
|
||||
@ -92,7 +96,7 @@ namespace osu.Game.Overlays.Wiki
|
||||
|
||||
protected override MarkdownHeading CreateHeading(HeadingBlock headingBlock) => new WikiPanelHeading(headingBlock)
|
||||
{
|
||||
IsFullWidth = IsFullWidth,
|
||||
IsFullWidth = isFullWidth,
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user