1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00

Add tooltip to key configuration button

This commit is contained in:
Dean Herbert 2019-02-15 11:56:33 +09:00
parent 2343557517
commit 1550908edb
3 changed files with 19 additions and 2 deletions

View File

@ -27,7 +27,7 @@ namespace osu.Game.Graphics.UserInterface
});
}
public IEnumerable<string> FilterTerms => new[] { Text };
public virtual IEnumerable<string> FilterTerms => new[] { Text };
public bool MatchingFilter
{

View File

@ -16,6 +16,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
new SettingsButton
{
Text = "Key configuration",
TooltipText = "Change global shortcut keys and gameplay bindings",
Action = keyConfig.ToggleVisibility
},
};

View File

@ -1,17 +1,33 @@
// 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.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Settings
{
public class SettingsButton : TriangleButton
public class SettingsButton : TriangleButton, IHasTooltip
{
public SettingsButton()
{
RelativeSizeAxes = Axes.X;
Padding = new MarginPadding { Left = SettingsOverlay.CONTENT_MARGINS, Right = SettingsOverlay.CONTENT_MARGINS };
}
public string TooltipText { get; set; }
public override IEnumerable<string> FilterTerms
{
get
{
if (TooltipText != null)
return base.FilterTerms.Append(TooltipText);
return base.FilterTerms;
}
}
}
}