1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 18:07:25 +08:00

Merge pull request #22545 from Joehuu/fix-user-profile-context-menu

Fix beatmap cards not showing context menu on user profile
This commit is contained in:
Dean Herbert 2023-02-08 17:07:28 +09:00 committed by GitHub
commit 21fa29f47f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 70 additions and 72 deletions

View File

@ -12,7 +12,6 @@ using osu.Framework.Graphics.Shapes;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.Cursor;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Overlays.Profile.Header.Components; using osu.Game.Overlays.Profile.Header.Components;
@ -104,76 +103,69 @@ namespace osu.Game.Overlays.Profile.Header
Colour = Colour4.Black.Opacity(0.25f), Colour = Colour4.Black.Opacity(0.25f),
} }
}, },
new OsuContextMenuContainer new FillFlowContainer
{ {
Anchor = Anchor.BottomLeft, AutoSizeAxes = Axes.Both,
Origin = Anchor.BottomLeft, Direction = FillDirection.Vertical,
RelativeSizeAxes = Axes.Y, Anchor = Anchor.CentreLeft,
AutoSizeAxes = Axes.X, Origin = Anchor.CentreLeft,
Child = new FillFlowContainer Children = new Drawable[]
{ {
AutoSizeAxes = Axes.Both, new FillFlowContainer
Direction = FillDirection.Vertical,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Children = new Drawable[]
{ {
new FillFlowContainer AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(5, 0),
Children = new Drawable[]
{ {
AutoSizeAxes = Axes.Both, usernameText = new OsuSpriteText
Direction = FillDirection.Horizontal,
Spacing = new Vector2(5, 0),
Children = new Drawable[]
{ {
usernameText = new OsuSpriteText Font = OsuFont.GetFont(size: 24, weight: FontWeight.Regular)
{ },
Font = OsuFont.GetFont(size: 24, weight: FontWeight.Regular) supporterTag = new SupporterIcon
},
supporterTag = new SupporterIcon
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Height = 15,
},
openUserExternally = new ExternalLinkButton
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},
groupBadgeFlow = new GroupBadgeFlow
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},
}
},
titleText = new OsuSpriteText
{
Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular),
Margin = new MarginPadding { Bottom = 5 }
},
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Children = new Drawable[]
{ {
userFlag = new UpdateableFlag Anchor = Anchor.CentreLeft,
{ Origin = Anchor.CentreLeft,
Size = new Vector2(28, 20), Height = 15,
ShowPlaceholderOnUnknown = false, },
}, openUserExternally = new ExternalLinkButton
userCountryText = new OsuSpriteText {
{ Anchor = Anchor.CentreLeft,
Font = OsuFont.GetFont(size: 14f, weight: FontWeight.Regular), Origin = Anchor.CentreLeft,
Margin = new MarginPadding { Left = 5 }, },
Origin = Anchor.CentreLeft, groupBadgeFlow = new GroupBadgeFlow
Anchor = Anchor.CentreLeft, {
} Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},
}
},
titleText = new OsuSpriteText
{
Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular),
Margin = new MarginPadding { Bottom = 5 }
},
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Children = new Drawable[]
{
userFlag = new UpdateableFlag
{
Size = new Vector2(28, 20),
ShowPlaceholderOnUnknown = false,
},
userCountryText = new OsuSpriteText
{
Font = OsuFont.GetFont(size: 14f, weight: FontWeight.Regular),
Margin = new MarginPadding { Left = 5 },
Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft,
} }
}, }
} },
}, }
}, },
} }
}, },

View File

@ -14,6 +14,7 @@ using osu.Framework.Input.Events;
using osu.Game.Extensions; using osu.Game.Extensions;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Cursor;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online; using osu.Game.Online;
@ -100,17 +101,22 @@ namespace osu.Game.Overlays
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
}; };
Add(sectionsContainer = new ProfileSectionsContainer Add(new OsuContextMenuContainer
{ {
ExpandableHeader = Header, RelativeSizeAxes = Axes.Both,
FixedHeader = tabs, Child = sectionsContainer = new ProfileSectionsContainer
HeaderBackground = new Box
{ {
// this is only visible as the ProfileTabControl background ExpandableHeader = Header,
Colour = ColourProvider.Background5, FixedHeader = tabs,
RelativeSizeAxes = Axes.Both HeaderBackground = new Box
}, {
// this is only visible as the ProfileTabControl background
Colour = ColourProvider.Background5,
RelativeSizeAxes = Axes.Both
},
}
}); });
sectionsContainer.SelectedSection.ValueChanged += section => sectionsContainer.SelectedSection.ValueChanged += section =>
{ {
if (lastSection != section.NewValue) if (lastSection != section.NewValue)