From 43569d69a76822b2133fee8e6d3430c6fcb4a07a Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Fri, 16 Jun 2017 16:13:23 +0800 Subject: [PATCH] Update transforms. --- .../Tests/TestCaseUserProfile.cs | 8 +----- osu.Game/Overlays/UserProfileOverlay.cs | 27 ++++++++++++++++++- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseUserProfile.cs b/osu.Desktop.VisualTests/Tests/TestCaseUserProfile.cs index e55d881d93..1dc880ea90 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseUserProfile.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseUserProfile.cs @@ -16,13 +16,7 @@ namespace osu.Desktop.VisualTests.Tests public override void Reset() { base.Reset(); - var profile = new UserProfileOverlay - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Horizontal = 50 }, - }; + var profile = new UserProfileOverlay(); Add(profile); AddStep("Show ppy", () => profile.ShowUser(new User diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index 2042348d94..a44ffd0319 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -5,6 +5,7 @@ using System.Linq; using OpenTK; using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics; @@ -17,13 +18,21 @@ using osu.Game.Users.Profile; namespace osu.Game.Overlays { - public class UserProfileOverlay : WaveOverlayContainer + public class UserProfileOverlay : FocusedOverlayContainer { private ProfileSection lastSection; private GetUserRequest userReq; private APIAccess api; public const float CONTENT_X_MARGIN = 50; + private const float transition_length = 500; + + public UserProfileOverlay() + { + RelativeSizeAxes = Axes.Both; + RelativePositionAxes = Axes.Both; + Padding = new MarginPadding { Horizontal = 50 }; + } [BackgroundDependencyLoader] private void load(APIAccess api) @@ -115,6 +124,22 @@ namespace osu.Game.Overlays Show(); } + protected override void PopIn() + { + MoveToY(0, transition_length, EasingTypes.OutQuint); + FadeIn(transition_length, EasingTypes.OutQuint); + + base.PopIn(); + } + + protected override void PopOut() + { + MoveToY(Height, transition_length, EasingTypes.OutQuint); + FadeOut(transition_length, EasingTypes.OutQuint); + + base.PopOut(); + } + private class ProfileTabControl : PageTabControl { private readonly Box bottom;