mirror of
https://github.com/ppy/osu
synced 2024-12-11 17:42:28 +00:00
Move action to private named method to avoid null inspection
This commit is contained in:
parent
6197ef426d
commit
36d99a2e34
@ -37,11 +37,7 @@ namespace osu.Game.Overlays
|
|||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.BottomRight,
|
||||||
Origin = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
Margin = new MarginPadding(20),
|
Margin = new MarginPadding(20),
|
||||||
Action = () =>
|
Action = scrollToTop
|
||||||
{
|
|
||||||
ScrollToStart();
|
|
||||||
Button.State = Visibility.Hidden;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,6 +54,12 @@ namespace osu.Game.Overlays
|
|||||||
Button.State = Target > button_scroll_position ? Visibility.Visible : Visibility.Hidden;
|
Button.State = Target > button_scroll_position ? Visibility.Visible : Visibility.Hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void scrollToTop()
|
||||||
|
{
|
||||||
|
ScrollToStart();
|
||||||
|
Button.State = Visibility.Hidden;
|
||||||
|
}
|
||||||
|
|
||||||
public class ScrollToTopButton : OsuHoverContainer
|
public class ScrollToTopButton : OsuHoverContainer
|
||||||
{
|
{
|
||||||
private const int fade_duration = 500;
|
private const int fade_duration = 500;
|
||||||
|
Loading…
Reference in New Issue
Block a user