mirror of
https://github.com/osukey/osukey.git
synced 2025-05-24 15:07:20 +09:00
use container for main title and sub title table of contents
This commit is contained in:
parent
9f45a28623
commit
525c16419a
@ -15,9 +15,9 @@ namespace osu.Game.Overlays.Wiki
|
|||||||
{
|
{
|
||||||
private readonly FillFlowContainer content;
|
private readonly FillFlowContainer content;
|
||||||
|
|
||||||
private FillFlowContainer lastItem;
|
private Container lastMainTitle;
|
||||||
|
|
||||||
private FillFlowContainer lastSubsection;
|
private Container lastSubTitle;
|
||||||
|
|
||||||
public WikiTableOfContents()
|
public WikiTableOfContents()
|
||||||
{
|
{
|
||||||
@ -37,29 +37,26 @@ namespace osu.Game.Overlays.Wiki
|
|||||||
|
|
||||||
if (subtitle)
|
if (subtitle)
|
||||||
{
|
{
|
||||||
lastSubsection ??= new FillFlowContainer
|
lastMainTitle.Margin = new MarginPadding(0);
|
||||||
|
|
||||||
|
if (lastSubTitle != null)
|
||||||
|
lastSubTitle.Margin = new MarginPadding(0);
|
||||||
|
|
||||||
|
content.Add(lastSubTitle = new Container
|
||||||
{
|
{
|
||||||
Direction = FillDirection.Vertical,
|
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Padding = new MarginPadding { Left = 10 },
|
Margin = new MarginPadding { Bottom = 10 },
|
||||||
};
|
Child = entry,
|
||||||
|
});
|
||||||
lastSubsection.Add(entry);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastSubsection != null)
|
lastSubTitle = null;
|
||||||
{
|
|
||||||
lastItem.Add(lastSubsection);
|
|
||||||
lastItem.Margin = new MarginPadding { Bottom = 10 };
|
|
||||||
lastSubsection = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
content.Add(lastItem = new FillFlowContainer
|
content.Add(lastMainTitle = new Container
|
||||||
{
|
{
|
||||||
Direction = FillDirection.Vertical,
|
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Margin = new MarginPadding { Bottom = 5 },
|
Margin = new MarginPadding { Bottom = 5 },
|
||||||
@ -92,6 +89,7 @@ namespace osu.Game.Overlays.Wiki
|
|||||||
f.AutoSizeAxes = Axes.Y;
|
f.AutoSizeAxes = Axes.Y;
|
||||||
});
|
});
|
||||||
Margin = new MarginPadding { Bottom = 2 };
|
Margin = new MarginPadding { Bottom = 2 };
|
||||||
|
Padding = new MarginPadding { Left = subtitle ? 10 : 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IEnumerable<Drawable> EffectTargets => new Drawable[] { textFlow };
|
protected override IEnumerable<Drawable> EffectTargets => new Drawable[] { textFlow };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user