mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Rearrange things somewhat
This commit is contained in:
52
osu.Game/Graphics/UserInterface/OsuTabDropDownMenuItem.cs
Normal file
52
osu.Game/Graphics/UserInterface/OsuTabDropDownMenuItem.cs
Normal file
@ -0,0 +1,52 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Game.Graphics;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Screens.Select.Filter;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public class OsuTabDropDownMenuItem<T> : DropDownMenuItem<T>
|
||||
{
|
||||
public OsuTabDropDownMenuItem(string text, T value) : base(text, value)
|
||||
{
|
||||
Foreground.Padding = new MarginPadding { Top = 4, Bottom = 4 };
|
||||
Foreground.Margin = new MarginPadding { Left = 7 };
|
||||
|
||||
Masking = true;
|
||||
CornerRadius = 6;
|
||||
Foreground.Add(new OsuSpriteText
|
||||
{
|
||||
Text = text,
|
||||
Origin = Anchor.CentreLeft,
|
||||
Anchor = Anchor.CentreLeft,
|
||||
});
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
BackgroundColour = Color4.Black.Opacity(0f);
|
||||
ForegroundColourHover = Color4.Black;
|
||||
ForegroundColourSelected = Color4.Black;
|
||||
|
||||
if (typeof(T) == typeof(SortMode))
|
||||
{
|
||||
BackgroundColourHover = colours.GreenLight;
|
||||
BackgroundColourSelected = colours.GreenLight;
|
||||
}
|
||||
else
|
||||
{
|
||||
BackgroundColourHover = colours.Blue;
|
||||
BackgroundColourSelected = colours.Blue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user