osu/osu.Game/Overlays/Settings/SettingsButton.cs
2021-10-10 21:45:41 +02:00

36 lines
1.1 KiB
C#

// 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.
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterfaceV2;
namespace osu.Game.Overlays.Settings
{
public class SettingsButton : RoundedButton, IHasTooltip
{
public SettingsButton()
{
RelativeSizeAxes = Axes.X;
Padding = new MarginPadding { Left = SettingsPanel.CONTENT_MARGINS, Right = SettingsPanel.CONTENT_MARGINS };
}
public LocalisableString TooltipText { get; set; }
public override IEnumerable<string> FilterTerms
{
get
{
if (TooltipText != default)
// TODO: this won't work as intended once the tooltip text is translated.
return base.FilterTerms.Append(TooltipText.ToString());
return base.FilterTerms;
}
}
}
}