osu/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.4 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 09:19:50 +00:00
using System;
using System.Collections.Generic;
using osu.Framework.Bindables;
2017-10-21 02:46:06 +00:00
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Localisation;
2021-10-10 18:32:56 +00:00
using osu.Game.Graphics.UserInterfaceV2;
2018-04-13 09:19:50 +00:00
2017-10-21 02:52:21 +00:00
namespace osu.Game.Overlays.Settings
2017-10-21 02:46:06 +00:00
{
public partial class SettingsButton : RoundedButton, IHasTooltip, IConditionalFilterable
2017-10-21 02:46:06 +00:00
{
public SettingsButton()
{
RelativeSizeAxes = Axes.X;
Padding = new MarginPadding { Left = SettingsPanel.CONTENT_MARGINS, Right = SettingsPanel.CONTENT_MARGINS };
2017-10-21 02:46:06 +00:00
}
public LocalisableString TooltipText { get; set; }
public IEnumerable<string> Keywords { get; set; } = Array.Empty<string>();
public BindableBool CanBeShown { get; } = new BindableBool(true);
IBindable<bool> IConditionalFilterable.CanBeShown => CanBeShown;
public override IEnumerable<LocalisableString> FilterTerms
{
get
{
if (TooltipText != default)
yield return TooltipText;
foreach (string s in Keywords)
yield return s;
foreach (LocalisableString s in base.FilterTerms)
yield return s;
}
}
2017-10-21 02:46:06 +00:00
}
}