1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-17 19:04:00 +08:00
Files
osu-lazer/osu.Game/Overlays/Profile/Header/Components/ProfileActionsButton.cs
T
Krzysztof Gutkowski 054ae2983d Extract user overlay actions button component (#36236)
This PR extracts the classes used for the actions dropdown on the user
profile overlay to separate components, in preparation to be used on the
team overlay (#32584).

Kinda RFC since I'm not sure if this is the best way to do this.

Co-authored-by: Dean Herbert <pe@ppy.sh>
2026-03-10 16:28:06 +09:00

63 lines
1.9 KiB
C#

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Extensions;
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.Framework.Graphics.UserInterface;
using osu.Game.Graphics.Containers;
using osuTK;
namespace osu.Game.Overlays.Profile.Header.Components
{
public abstract partial class ProfileActionsButton : OsuHoverContainer, IHasPopover
{
private Box background = null!;
protected override IEnumerable<Drawable> EffectTargets => [background];
[Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!;
[BackgroundDependencyLoader]
private void load()
{
IdleColour = colourProvider.Background2;
HoverColour = colourProvider.Background1;
Size = new Vector2(40);
Masking = true;
CornerRadius = 20;
Child = new CircularContainer
{
Masking = true,
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
background = new Box
{
RelativeSizeAxes = Axes.Both,
},
new SpriteIcon
{
Size = new Vector2(12),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Icon = FontAwesome.Solid.EllipsisV,
},
}
};
Action = this.ShowPopover;
}
public abstract Popover GetPopover();
}
}