1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-26 23:32:55 +08:00
osu-lazer/osu.Game/Overlays/Settings/SettingsButton.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
1.3 KiB
C#
Raw Normal View History

// 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
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Allocation;
2017-10-21 10:46:06 +08:00
using osu.Framework.Graphics;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Localisation;
using osu.Game.Graphics;
2021-10-11 02:32:56 +08:00
using osu.Game.Graphics.UserInterfaceV2;
2018-04-13 17:19:50 +08:00
2017-10-21 10:52:21 +08:00
namespace osu.Game.Overlays.Settings
2017-10-21 10:46:06 +08:00
{
2021-10-11 02:32:56 +08:00
public class SettingsButton : RoundedButton, IHasTooltip
2017-10-21 10:46:06 +08:00
{
public SettingsButton()
{
RelativeSizeAxes = Axes.X;
Padding = new MarginPadding { Left = SettingsPanel.CONTENT_MARGINS, Right = SettingsPanel.CONTENT_MARGINS };
2017-10-21 10:46:06 +08:00
}
[BackgroundDependencyLoader(true)]
private void load([CanBeNull] OverlayColourProvider overlayColourProvider, OsuColour colours)
{
DefaultBackgroundColour = overlayColourProvider?.Highlight1 ?? colours.Blue3;
}
public LocalisableString TooltipText { get; set; }
public override IEnumerable<LocalisableString> FilterTerms
{
get
{
if (TooltipText != default)
return base.FilterTerms.Append(TooltipText);
return base.FilterTerms;
}
}
2017-10-21 10:46:06 +08:00
}
}