mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 04:13:00 +08:00
Update user profile section tabs and rename classes for better readibility
This commit is contained in:
parent
816418742e
commit
46ebf6ef78
@ -24,7 +24,7 @@ namespace osu.Game.Overlays
|
||||
private GetUserRequest userReq;
|
||||
protected ProfileHeader Header;
|
||||
private ProfileSectionsContainer sectionsContainer;
|
||||
private ProfileTabControl tabs;
|
||||
private ProfileSectionTabControl tabs;
|
||||
|
||||
public const float CONTENT_X_MARGIN = 70;
|
||||
|
||||
@ -62,7 +62,7 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
: Array.Empty<ProfileSection>();
|
||||
|
||||
tabs = new ProfileTabControl
|
||||
tabs = new ProfileSectionTabControl
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
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.AutoSizeAxes |= Axes.X;
|
||||
TabContainer.Anchor |= 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]
|
||||
@ -170,12 +174,14 @@ namespace osu.Game.Overlays
|
||||
AccentColour = colourProvider.Highlight1;
|
||||
}
|
||||
|
||||
private class ProfileTabItem : OverlayTabItem
|
||||
private class ProfileSectionTabItem : OverlayTabItem
|
||||
{
|
||||
public ProfileTabItem(ProfileSection value)
|
||||
public ProfileSectionTabItem(ProfileSection value)
|
||||
: base(value)
|
||||
{
|
||||
Text.Text = value.Title;
|
||||
Bar.ExpandedSize = 10;
|
||||
Bar.Margin = new MarginPadding { Bottom = bar_height };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user