introduce tooltip to rounded button with subclass instead

This commit is contained in:
OliBomby 2024-10-05 15:16:29 +02:00
parent ad734b1a13
commit cc29e8c16d
2 changed files with 9 additions and 5 deletions

View File

@ -7,10 +7,12 @@
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics.UserInterfaceV2;
@ -150,7 +152,7 @@ private void load()
Spacing = new Vector2(0f, 10f),
Children = new Drawable[]
{
gridFromPointsButton = new RoundedButton
gridFromPointsButton = new TooltipRoundedButton
{
Action = () => GridFromPointsClicked?.Invoke(),
RelativeSizeAxes = Axes.X,
@ -311,6 +313,11 @@ public OutlineTriangle(bool outlineOnly, float size)
}
}
public partial class TooltipRoundedButton : RoundedButton, IHasTooltip
{
public virtual LocalisableString TooltipText { get; set; }
}
public enum PositionSnapGridType
{
Square,

View File

@ -8,7 +8,6 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Game.Graphics.Backgrounds;
@ -18,7 +17,7 @@
namespace osu.Game.Graphics.UserInterfaceV2
{
public partial class RoundedButton : OsuButton, IFilterable, IHasTooltip
public partial class RoundedButton : OsuButton, IFilterable
{
protected TrianglesV2? Triangles { get; private set; }
@ -108,7 +107,5 @@ public bool MatchingFilter
}
public bool FilteringActive { get; set; }
public virtual LocalisableString TooltipText { get; set; }
}
}