2019-01-24 16:43:03 +08:00
|
|
|
|
// 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.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
|
|
|
|
using osuTK.Graphics;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Extensions.Color4Extensions;
|
|
|
|
|
using osu.Framework.Graphics;
|
2019-04-02 13:51:28 +08:00
|
|
|
|
using osu.Framework.Graphics.Effects;
|
2020-09-11 15:46:11 +08:00
|
|
|
|
using osu.Game.Collections;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Music
|
|
|
|
|
{
|
2020-09-11 15:46:11 +08:00
|
|
|
|
/// <summary>
|
2022-07-28 12:48:15 +08:00
|
|
|
|
/// A <see cref="CollectionDropdown"/> for use in the <see cref="NowPlayingOverlay"/>.
|
2020-09-11 15:46:11 +08:00
|
|
|
|
/// </summary>
|
2022-11-24 13:32:20 +08:00
|
|
|
|
public partial class NowPlayingCollectionDropdown : CollectionDropdown
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2020-09-11 15:58:18 +08:00
|
|
|
|
protected override bool ShowManageCollectionsItem => false;
|
|
|
|
|
|
2020-09-11 15:46:11 +08:00
|
|
|
|
protected override CollectionDropdownHeader CreateCollectionHeader() => new CollectionsHeader();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2020-09-11 15:46:11 +08:00
|
|
|
|
protected override CollectionDropdownMenu CreateCollectionMenu() => new CollectionsMenu();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2022-11-24 13:32:20 +08:00
|
|
|
|
private partial class CollectionsMenu : CollectionDropdownMenu
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
public CollectionsMenu()
|
|
|
|
|
{
|
2020-04-11 14:29:52 +08:00
|
|
|
|
Masking = true;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
CornerRadius = 5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
BackgroundColour = colours.Gray4;
|
2021-10-20 04:47:18 +08:00
|
|
|
|
SelectionColour = colours.Gray5;
|
|
|
|
|
HoverColour = colours.Gray6;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-24 13:32:20 +08:00
|
|
|
|
private partial class CollectionsHeader : CollectionDropdownHeader
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
BackgroundColour = colours.Gray4;
|
2021-10-17 00:33:17 +08:00
|
|
|
|
BackgroundColourHover = colours.Gray6;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CollectionsHeader()
|
|
|
|
|
{
|
|
|
|
|
CornerRadius = 5;
|
|
|
|
|
Height = 30;
|
|
|
|
|
Icon.Size = new Vector2(14);
|
|
|
|
|
Icon.Margin = new MarginPadding(0);
|
|
|
|
|
Foreground.Padding = new MarginPadding { Top = 4, Bottom = 4, Left = 10, Right = 10 };
|
|
|
|
|
EdgeEffect = new EdgeEffectParameters
|
|
|
|
|
{
|
|
|
|
|
Type = EdgeEffectType.Shadow,
|
|
|
|
|
Colour = Color4.Black.Opacity(0.3f),
|
|
|
|
|
Radius = 3,
|
|
|
|
|
Offset = new Vector2(0f, 1f),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|