mirror of https://github.com/ppy/osu
Move text and `isFullWidth` parameters to constructor
This commit is contained in:
parent
a7865d3f22
commit
d66f07fccb
|
@ -77,10 +77,8 @@ private IEnumerable<Drawable[]> createPanels(HtmlDocument html)
|
|||
{
|
||||
yield return new Drawable[]
|
||||
{
|
||||
new WikiPanelContainer
|
||||
new WikiPanelContainer(panelsNode[i].InnerText, true)
|
||||
{
|
||||
Text = panelsNode[i].InnerText,
|
||||
IsFullWidth = true,
|
||||
Width = 2,
|
||||
},
|
||||
null,
|
||||
|
@ -91,14 +89,8 @@ private IEnumerable<Drawable[]> createPanels(HtmlDocument html)
|
|||
{
|
||||
yield return new Drawable[]
|
||||
{
|
||||
new WikiPanelContainer
|
||||
{
|
||||
Text = panelsNode[i].InnerText,
|
||||
},
|
||||
new WikiPanelContainer
|
||||
{
|
||||
Text = panelsNode[i + 1].InnerText,
|
||||
},
|
||||
new WikiPanelContainer(panelsNode[i].InnerText),
|
||||
new WikiPanelContainer(panelsNode[i + 1].InnerText),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,12 +23,15 @@ public class WikiPanelContainer : Container
|
|||
{
|
||||
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 @@ private void load(OverlayColourProvider colourProvider)
|
|||
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 @@ protected override void Update()
|
|||
|
||||
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 @@ protected override MarkdownParagraph CreateParagraph(ParagraphBlock paragraphBlo
|
|||
|
||||
protected override MarkdownHeading CreateHeading(HeadingBlock headingBlock) => new WikiPanelHeading(headingBlock)
|
||||
{
|
||||
IsFullWidth = IsFullWidth,
|
||||
IsFullWidth = isFullWidth,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue