1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 03:27:24 +08:00

Add popover containers to overlays

This commit is contained in:
ansel 2022-10-17 13:41:46 +03:00
parent 7ed26369a3
commit d7e5bcbd3c
2 changed files with 41 additions and 29 deletions

View File

@ -10,6 +10,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Game.Online.API.Requests;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Overlays.BeatmapSet;
@ -44,20 +45,25 @@ namespace osu.Game.Overlays
Info info;
CommentsSection comments;
Child = new FillFlowContainer
Child = new PopoverContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 20),
Children = new Drawable[]
Child = new FillFlowContainer
{
info = new Info(),
new ScoresContainer
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 20),
Children = new Drawable[]
{
Beatmap = { BindTarget = Header.HeaderContent.Picker.Beatmap }
},
comments = new CommentsSection()
info = new Info(),
new ScoresContainer
{
Beatmap = { BindTarget = Header.HeaderContent.Picker.Beatmap }
},
comments = new CommentsSection()
}
}
};

View File

@ -10,6 +10,7 @@ using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
@ -63,28 +64,33 @@ namespace osu.Game.Overlays.Changelog
{
CommentsContainer comments;
Children = new Drawable[]
Child = new PopoverContainer
{
new ChangelogBuildWithNavigation(build) { SelectBuild = SelectBuild },
new Box
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Children = new Drawable[]
{
RelativeSizeAxes = Axes.X,
Height = 2,
Colour = colourProvider.Background6,
Margin = new MarginPadding { Top = 30 },
},
new ChangelogSupporterPromo
{
Alpha = api.LocalUser.Value.IsSupporter ? 0 : 1,
},
new Box
{
RelativeSizeAxes = Axes.X,
Height = 2,
Colour = colourProvider.Background6,
Alpha = api.LocalUser.Value.IsSupporter ? 0 : 1,
},
comments = new CommentsContainer()
new ChangelogBuildWithNavigation(build) { SelectBuild = SelectBuild },
new Box
{
RelativeSizeAxes = Axes.X,
Height = 2,
Colour = colourProvider.Background6,
Margin = new MarginPadding { Top = 30 },
},
new ChangelogSupporterPromo
{
Alpha = api.LocalUser.Value.IsSupporter ? 0 : 1,
},
new Box
{
RelativeSizeAxes = Axes.X,
Height = 2,
Colour = colourProvider.Background6,
Alpha = api.LocalUser.Value.IsSupporter ? 0 : 1,
},
comments = new CommentsContainer()
}
};
comments.ShowComments(CommentableType.Build, build.Id);