1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 10:27:35 +08:00
osu-lazer/osu.Game/Graphics/UserInterface/OsuContextMenu.cs

39 lines
1.3 KiB
C#
Raw Normal View History

2017-06-12 17:56:07 +08:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Graphics.UserInterface
{
2017-08-28 13:42:52 +08:00
public class OsuContextMenu : OsuMenu
2017-06-12 17:56:07 +08:00
{
private const int fade_duration = 250;
2017-06-12 17:56:07 +08:00
public OsuContextMenu()
2017-09-04 08:10:04 +08:00
: base(Direction.Vertical)
2017-06-12 17:56:07 +08:00
{
2017-09-04 08:10:04 +08:00
MaskingContainer.CornerRadius = 5;
MaskingContainer.EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.1f),
Radius = 4,
};
2017-09-04 08:10:04 +08:00
ItemsContainer.Padding = new MarginPadding { Vertical = DrawableOsuMenuItem.MARGIN_VERTICAL };
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
BackgroundColour = colours.ContextMenuGray;
}
protected override void AnimateOpen() => this.FadeIn(fade_duration, Easing.OutQuint);
protected override void AnimateClose() => this.FadeOut(fade_duration, Easing.OutQuint);
2017-06-12 17:56:07 +08:00
}
}