From 36d99a2e34297f1a2c7f0dacb2704ab8e61a463f Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Fri, 5 Nov 2021 03:51:08 +0300 Subject: [PATCH] Move action to private named method to avoid null inspection --- osu.Game/Overlays/OverlayScrollContainer.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/OverlayScrollContainer.cs b/osu.Game/Overlays/OverlayScrollContainer.cs index ca5fc90027..7fe188eb04 100644 --- a/osu.Game/Overlays/OverlayScrollContainer.cs +++ b/osu.Game/Overlays/OverlayScrollContainer.cs @@ -37,11 +37,7 @@ public OverlayScrollContainer() Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Margin = new MarginPadding(20), - Action = () => - { - ScrollToStart(); - Button.State = Visibility.Hidden; - } + Action = scrollToTop }); } @@ -58,6 +54,12 @@ protected override void UpdateAfterChildren() Button.State = Target > button_scroll_position ? Visibility.Visible : Visibility.Hidden; } + private void scrollToTop() + { + ScrollToStart(); + Button.State = Visibility.Hidden; + } + public class ScrollToTopButton : OsuHoverContainer { private const int fade_duration = 500;