mirror of https://github.com/ppy/osu
Move action to private named method to avoid null inspection
This commit is contained in:
parent
6197ef426d
commit
36d99a2e34
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue