1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 08:13:31 +08:00

Update user profile section tabs and rename classes for better readibility

This commit is contained in:
TheWildTree 2020-03-26 15:44:22 +01:00
parent 816418742e
commit 46ebf6ef78

View File

@ -24,7 +24,7 @@ namespace osu.Game.Overlays
private GetUserRequest userReq; private GetUserRequest userReq;
protected ProfileHeader Header; protected ProfileHeader Header;
private ProfileSectionsContainer sectionsContainer; private ProfileSectionsContainer sectionsContainer;
private ProfileTabControl tabs; private ProfileSectionTabControl tabs;
public const float CONTENT_X_MARGIN = 70; public const float CONTENT_X_MARGIN = 70;
@ -62,7 +62,7 @@ namespace osu.Game.Overlays
} }
: Array.Empty<ProfileSection>(); : Array.Empty<ProfileSection>();
tabs = new ProfileTabControl tabs = new ProfileSectionTabControl
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
@ -149,19 +149,23 @@ namespace osu.Game.Overlays
} }
} }
private class ProfileTabControl : OverlayTabControl<ProfileSection> private class ProfileSectionTabControl : OverlayTabControl<ProfileSection>
{ {
public ProfileTabControl() private const float bar_height = 2;
public ProfileSectionTabControl()
{ {
TabContainer.RelativeSizeAxes &= ~Axes.X; TabContainer.RelativeSizeAxes &= ~Axes.X;
TabContainer.AutoSizeAxes |= Axes.X; TabContainer.AutoSizeAxes |= Axes.X;
TabContainer.Anchor |= Anchor.x1; TabContainer.Anchor |= Anchor.x1;
TabContainer.Origin |= Anchor.x1; TabContainer.Origin |= Anchor.x1;
BarHeight = bar_height;
} }
protected override TabItem<ProfileSection> CreateTabItem(ProfileSection value) => new ProfileTabItem(value) protected override TabItem<ProfileSection> CreateTabItem(ProfileSection value) => new ProfileSectionTabItem(value)
{ {
AccentColour = AccentColour AccentColour = AccentColour,
}; };
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
@ -170,12 +174,14 @@ namespace osu.Game.Overlays
AccentColour = colourProvider.Highlight1; AccentColour = colourProvider.Highlight1;
} }
private class ProfileTabItem : OverlayTabItem private class ProfileSectionTabItem : OverlayTabItem
{ {
public ProfileTabItem(ProfileSection value) public ProfileSectionTabItem(ProfileSection value)
: base(value) : base(value)
{ {
Text.Text = value.Title; Text.Text = value.Title;
Bar.ExpandedSize = 10;
Bar.Margin = new MarginPadding { Bottom = bar_height };
} }
} }
} }