2018-01-05 19:21:19 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-05-17 20:32:16 +08:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using OpenTK;
|
|
|
|
|
using OpenTK.Graphics;
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Extensions.Color4Extensions;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.UserInterface;
|
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
|
|
2017-05-17 22:14:09 +08:00
|
|
|
|
namespace osu.Game.Overlays.Music
|
2017-05-17 20:32:16 +08:00
|
|
|
|
{
|
2017-05-17 22:14:09 +08:00
|
|
|
|
public class CollectionsDropdown<T> : OsuDropdown<T>
|
2017-05-17 20:32:16 +08:00
|
|
|
|
{
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
2017-08-29 17:17:01 +08:00
|
|
|
|
AccentColour = colours.Gray6;
|
2017-05-17 20:32:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-08-29 17:17:01 +08:00
|
|
|
|
protected override DropdownHeader CreateHeader() => new CollectionsHeader();
|
2017-08-25 14:58:09 +08:00
|
|
|
|
|
|
|
|
|
protected override DropdownMenu CreateMenu() => new CollectionsMenu();
|
|
|
|
|
|
|
|
|
|
private class CollectionsMenu : OsuDropdownMenu
|
|
|
|
|
{
|
|
|
|
|
public CollectionsMenu()
|
2017-05-17 22:14:09 +08:00
|
|
|
|
{
|
|
|
|
|
CornerRadius = 5;
|
2017-06-12 11:48:47 +08:00
|
|
|
|
EdgeEffect = new EdgeEffectParameters
|
2017-05-17 22:14:09 +08:00
|
|
|
|
{
|
|
|
|
|
Type = EdgeEffectType.Shadow,
|
|
|
|
|
Colour = Color4.Black.Opacity(0.3f),
|
|
|
|
|
Radius = 3,
|
|
|
|
|
Offset = new Vector2(0f, 1f),
|
|
|
|
|
};
|
|
|
|
|
}
|
2017-08-25 14:58:09 +08:00
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
BackgroundColour = colours.Gray4;
|
|
|
|
|
}
|
2017-05-17 20:32:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-08-25 14:58:09 +08:00
|
|
|
|
private class CollectionsHeader : OsuDropdownHeader
|
2017-05-17 20:32:16 +08:00
|
|
|
|
{
|
2017-05-17 22:14:09 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
2017-08-25 14:58:09 +08:00
|
|
|
|
BackgroundColour = colours.Gray4;
|
2017-05-17 22:14:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-08-25 14:58:09 +08:00
|
|
|
|
public CollectionsHeader()
|
2017-05-17 20:32:16 +08:00
|
|
|
|
{
|
2017-05-17 22:14:09 +08:00
|
|
|
|
CornerRadius = 5;
|
2017-08-25 14:58:09 +08:00
|
|
|
|
Height = 30;
|
|
|
|
|
Icon.Size = new Vector2(14);
|
|
|
|
|
Icon.Margin = new MarginPadding(0);
|
|
|
|
|
Foreground.Padding = new MarginPadding { Top = 4, Bottom = 4, Left = 10, Right = 10 };
|
2017-06-12 11:48:47 +08:00
|
|
|
|
EdgeEffect = new EdgeEffectParameters
|
2017-05-17 22:14:09 +08:00
|
|
|
|
{
|
|
|
|
|
Type = EdgeEffectType.Shadow,
|
|
|
|
|
Colour = Color4.Black.Opacity(0.3f),
|
|
|
|
|
Radius = 3,
|
|
|
|
|
Offset = new Vector2(0f, 1f),
|
|
|
|
|
};
|
|
|
|
|
}
|
2017-05-17 20:32:16 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-05-17 22:14:09 +08:00
|
|
|
|
}
|