Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable NRT on IHasCustomTooltip interface #5260

Merged
merged 1 commit into from Jun 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions osu.Framework/Graphics/Cursor/IHasCustomTooltip.cs
@@ -1,8 +1,6 @@
// 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.

#nullable disable

namespace osu.Framework.Graphics.Cursor
{
/// <summary>
Expand All @@ -24,20 +22,21 @@ public interface IHasCustomTooltip : ITooltipContentProvider
/// <summary>
/// Tooltip text that shows when hovering the drawable.
/// </summary>
object TooltipContent { get; }
object? TooltipContent { get; }
}

/// <inheritdoc />
public interface IHasCustomTooltip<TContent> : IHasCustomTooltip
where TContent : class
{
ITooltip IHasCustomTooltip.GetCustomTooltip() => GetCustomTooltip();

/// <inheritdoc cref="IHasCustomTooltip.GetCustomTooltip"/>
new ITooltip<TContent> GetCustomTooltip();

object IHasCustomTooltip.TooltipContent => TooltipContent;
object? IHasCustomTooltip.TooltipContent => TooltipContent;

/// <inheritdoc cref="IHasCustomTooltip.TooltipContent"/>
new TContent TooltipContent { get; }
new TContent? TooltipContent { get; }
}
}