mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Add ability to not create content for headers
Rather than creating an empty container
This commit is contained in:
parent
ca3e8db79f
commit
647c83e6c8
@ -75,7 +75,7 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
|
|
||||||
protected override Drawable CreateBackground() => new HeaderBackground();
|
protected override Drawable CreateBackground() => new HeaderBackground();
|
||||||
|
|
||||||
protected override Drawable CreateContent() => new Container
|
protected override Drawable CreateContent => new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
|
@ -63,8 +63,6 @@ namespace osu.Game.Overlays.News
|
|||||||
|
|
||||||
protected override Drawable CreateBackground() => new NewsHeaderBackground();
|
protected override Drawable CreateBackground() => new NewsHeaderBackground();
|
||||||
|
|
||||||
protected override Drawable CreateContent() => new Container();
|
|
||||||
|
|
||||||
protected override ScreenTitle CreateTitle() => title = new NewsHeaderTitle();
|
protected override ScreenTitle CreateTitle() => title = new NewsHeaderTitle();
|
||||||
|
|
||||||
private class NewsHeaderBackground : Sprite
|
private class NewsHeaderBackground : Sprite
|
||||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Overlays
|
|||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
|
|
||||||
Children = new Drawable[]
|
AddRange(new[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
@ -50,20 +50,24 @@ namespace osu.Game.Overlays
|
|||||||
Padding = new MarginPadding { Left = UserProfileOverlay.CONTENT_X_MARGIN }
|
Padding = new MarginPadding { Left = UserProfileOverlay.CONTENT_X_MARGIN }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
new Container
|
});
|
||||||
|
|
||||||
|
if (CreateContent != null)
|
||||||
|
{
|
||||||
|
Add(new Container
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Top = cover_height },
|
Margin = new MarginPadding { Top = cover_height },
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Child = CreateContent()
|
Child = CreateContent
|
||||||
}
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract Drawable CreateBackground();
|
protected abstract Drawable CreateBackground();
|
||||||
|
|
||||||
protected abstract Drawable CreateContent();
|
protected virtual Drawable CreateContent => null;
|
||||||
|
|
||||||
protected abstract ScreenTitle CreateTitle();
|
protected abstract ScreenTitle CreateTitle();
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ namespace osu.Game.Overlays.Profile
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override Drawable CreateContent() => new FillFlowContainer
|
protected override Drawable CreateContent => new FillFlowContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user