1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 18:32:55 +08:00

Remove notification upon copy

This commit is contained in:
Andrew Hong 2022-07-26 04:19:54 -04:00
parent a8e315abf0
commit aaf6ec05bb

View File

@ -13,8 +13,6 @@ using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Game.Overlays;
using osu.Game.Overlays.Notifications;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
@ -24,9 +22,6 @@ namespace osu.Game.Graphics.UserInterface
{ {
public string Link { get; set; } public string Link { get; set; }
[Resolved]
private INotificationOverlay notificationOverlay { get; set; }
private Color4 hoverColour; private Color4 hoverColour;
[Resolved] [Resolved]
@ -49,15 +44,6 @@ namespace osu.Game.Graphics.UserInterface
}; };
} }
private void copyUrl()
{
host.GetClipboard()?.SetText(Link);
notificationOverlay.Post(new SimpleNotification
{
Text = "Copied URL!"
});
}
public MenuItem[] ContextMenuItems public MenuItem[] ContextMenuItems
{ {
get get
@ -67,7 +53,7 @@ namespace osu.Game.Graphics.UserInterface
if (Link != null) if (Link != null)
{ {
items.Add(new OsuMenuItem("Open", MenuItemType.Standard, () => host.OpenUrlExternally(Link))); items.Add(new OsuMenuItem("Open", MenuItemType.Standard, () => host.OpenUrlExternally(Link)));
items.Add(new OsuMenuItem("Copy URL", MenuItemType.Standard, () => copyUrl())); items.Add(new OsuMenuItem("Copy URL", MenuItemType.Standard, () => host.GetClipboard()?.SetText(Link)));
} }
return items.ToArray(); return items.ToArray();