2019-01-24 08:43:03 +00: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 09:19:50 +00:00
|
|
|
|
|
2019-02-15 02:56:33 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
2019-02-15 02:56:33 +00:00
|
|
|
|
using osu.Framework.Graphics.Cursor;
|
2021-06-25 17:10:04 +00:00
|
|
|
|
using osu.Framework.Localisation;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Settings
|
|
|
|
|
{
|
2019-02-15 02:56:33 +00:00
|
|
|
|
public class SettingsButton : TriangleButton, IHasTooltip
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
|
|
|
|
public SettingsButton()
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
2019-05-14 01:45:05 +00:00
|
|
|
|
Padding = new MarginPadding { Left = SettingsPanel.CONTENT_MARGINS, Right = SettingsPanel.CONTENT_MARGINS };
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
2019-02-15 02:56:33 +00:00
|
|
|
|
|
2021-06-25 17:10:04 +00:00
|
|
|
|
public LocalisableString TooltipText { get; set; }
|
2019-02-15 02:56:33 +00:00
|
|
|
|
|
|
|
|
|
public override IEnumerable<string> FilterTerms
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2021-06-25 17:10:04 +00:00
|
|
|
|
if (TooltipText != default)
|
|
|
|
|
// TODO: this won't work as intended once the tooltip text is translated.
|
|
|
|
|
return base.FilterTerms.Append(TooltipText.ToString());
|
2019-02-15 02:56:33 +00:00
|
|
|
|
|
|
|
|
|
return base.FilterTerms;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|