From c86bb2e755d9c43bfb7130d22883b19f40c8e3d2 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Tue, 7 Jul 2020 00:01:06 +0300 Subject: [PATCH] Use DrawableDate tooltip for DateContainer --- osu.Game/Graphics/DrawableDate.cs | 2 +- osu.Game/Overlays/News/NewsCard.cs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/DrawableDate.cs b/osu.Game/Graphics/DrawableDate.cs index 8b6df4a834..953b7541e1 100644 --- a/osu.Game/Graphics/DrawableDate.cs +++ b/osu.Game/Graphics/DrawableDate.cs @@ -82,7 +82,7 @@ namespace osu.Game.Graphics public object TooltipContent => Date; - private class DateTooltip : VisibilityContainer, ITooltip + public class DateTooltip : VisibilityContainer, ITooltip { private readonly OsuSpriteText dateText, timeText; private readonly Box background; diff --git a/osu.Game/Overlays/News/NewsCard.cs b/osu.Game/Overlays/News/NewsCard.cs index 08a9fccc4e..c22a3268bf 100644 --- a/osu.Game/Overlays/News/NewsCard.cs +++ b/osu.Game/Overlays/News/NewsCard.cs @@ -156,9 +156,11 @@ namespace osu.Game.Overlays.News } } - private class DateContainer : CircularContainer, IHasTooltip + private class DateContainer : CircularContainer, IHasCustomTooltip { - public string TooltipText => date.ToString("d MMMM yyyy hh:mm:ss UTCz"); + public ITooltip GetCustomTooltip() => new DrawableDate.DateTooltip(); + + public object TooltipContent => date; private readonly DateTimeOffset date;