mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 17:37:23 +09:00
Update usage design.
This commit is contained in:
parent
13d9f3b9bb
commit
53bd22cf9c
@ -16,21 +16,31 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
public override void Reset()
|
public override void Reset()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.Reset();
|
||||||
var userpage = new UserProfileOverlay(new User
|
var profile = new UserProfileOverlay
|
||||||
{
|
|
||||||
Username = @"peppy",
|
|
||||||
Id = 2,
|
|
||||||
Country = new Country { FullName = @"Australia", FlagName = @"AU" },
|
|
||||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg"
|
|
||||||
})
|
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Padding = new MarginPadding { Horizontal = 50 },
|
Padding = new MarginPadding { Horizontal = 50 },
|
||||||
State = Visibility.Visible
|
|
||||||
};
|
};
|
||||||
Add(userpage);
|
Add(profile);
|
||||||
|
|
||||||
|
AddStep("Show ppy", () => profile.ShowUser(new User
|
||||||
|
{
|
||||||
|
Username = @"peppy",
|
||||||
|
Id = 2,
|
||||||
|
Country = new Country { FullName = @"Australia", FlagName = @"AU" },
|
||||||
|
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg"
|
||||||
|
}));
|
||||||
|
AddStep("Show flyte", () => profile.ShowUser(new User
|
||||||
|
{
|
||||||
|
Username = @"flyte",
|
||||||
|
Id = 3103765,
|
||||||
|
Country = new Country { FullName = @"Japan", FlagName = @"JP" },
|
||||||
|
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c6.jpg"
|
||||||
|
}));
|
||||||
|
AddStep("Hide", profile.Hide);
|
||||||
|
AddStep("Show without reload", profile.Show);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,10 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
public const float CONTENT_X_MARGIN = 50;
|
public const float CONTENT_X_MARGIN = 50;
|
||||||
|
|
||||||
public UserProfileOverlay(User user)
|
public void ShowUser(User user)
|
||||||
{
|
{
|
||||||
|
Clear();
|
||||||
|
lastSection = null;
|
||||||
var sections = new ProfileSection[]
|
var sections = new ProfileSection[]
|
||||||
{
|
{
|
||||||
new AboutSection(),
|
new AboutSection(),
|
||||||
@ -87,6 +89,7 @@ namespace osu.Game.Overlays
|
|||||||
sectionsContainer.ScrollContainer.ScrollIntoView(lastSection);
|
sectionsContainer.ScrollContainer.ScrollIntoView(lastSection);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ProfileTabControl : PageTabControl<ProfileSection>
|
private class ProfileTabControl : PageTabControl<ProfileSection>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user