1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 06:12:56 +08:00

Normalise login overlay padding/spacing

This commit is contained in:
Joseph Madamba 2023-06-25 12:26:01 -07:00
parent 671f84e32b
commit 6ebc2581c2
No known key found for this signature in database
GPG Key ID: 8B746C7BDDF0BD76
4 changed files with 42 additions and 41 deletions

View File

@ -43,43 +43,50 @@ namespace osu.Game.Overlays.Login
[BackgroundDependencyLoader(permitNulls: true)]
private void load(OsuConfigManager config, AccountCreationOverlay accountCreation)
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FillDirection.Vertical;
Spacing = new Vector2(0, SettingsSection.ITEM_SPACING);
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;
Padding = new MarginPadding
{
Top = 5,
Bottom = 24,
};
ErrorTextFlowContainer errorText;
LinkFlowContainer forgottenPasswordLink;
Children = new Drawable[]
{
new OsuSpriteText
{
Text = LoginPanelStrings.Account.ToUpper(),
Font = OsuFont.GetFont(weight: FontWeight.Bold),
},
username = new OsuTextBox
{
PlaceholderText = UsersStrings.LoginUsername.ToLower(),
RelativeSizeAxes = Axes.X,
Text = api.ProvidedUsername,
TabbableContentContainer = this
},
password = new OsuPasswordTextBox
{
PlaceholderText = UsersStrings.LoginPassword.ToLower(),
RelativeSizeAxes = Axes.X,
TabbableContentContainer = this,
},
errorText = new ErrorTextFlowContainer
new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Alpha = 0,
Padding = new MarginPadding { Horizontal = SettingsPanel.CONTENT_MARGINS },
Direction = FillDirection.Vertical,
Spacing = new Vector2(0f, SettingsSection.ITEM_SPACING),
Children = new Drawable[]
{
new OsuSpriteText
{
Text = LoginPanelStrings.Account.ToUpper(),
Font = OsuFont.GetFont(weight: FontWeight.Bold),
},
username = new OsuTextBox
{
PlaceholderText = UsersStrings.LoginUsername.ToLower(),
RelativeSizeAxes = Axes.X,
Text = api.ProvidedUsername,
TabbableContentContainer = this
},
password = new OsuPasswordTextBox
{
PlaceholderText = UsersStrings.LoginPassword.ToLower(),
RelativeSizeAxes = Axes.X,
TabbableContentContainer = this,
},
errorText = new ErrorTextFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Alpha = 0,
},
},
},
new SettingsCheckbox
{
@ -93,11 +100,7 @@ namespace osu.Game.Overlays.Login
},
forgottenPasswordLink = new LinkFlowContainer
{
Padding = new MarginPadding
{
Left = SettingsPanel.CONTENT_MARGINS,
Bottom = SettingsSection.ITEM_SPACING
},
Padding = new MarginPadding { Horizontal = SettingsPanel.CONTENT_MARGINS },
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
},

View File

@ -17,6 +17,7 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
using osu.Game.Online.API;
using osu.Game.Overlays.Settings;
using osu.Game.Users;
using osuTK;
@ -89,8 +90,9 @@ namespace osu.Game.Overlays.Login
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = SettingsPanel.CONTENT_MARGINS },
Direction = FillDirection.Vertical,
Spacing = new Vector2(0f, 5f),
Spacing = new Vector2(0f, SettingsSection.ITEM_SPACING),
Children = new Drawable[]
{
new LoadingSpinner
@ -106,7 +108,6 @@ namespace osu.Game.Overlays.Login
TextAnchor = Anchor.TopCentre,
AutoSizeAxes = Axes.Both,
Text = state.NewValue == APIState.Failing ? ToolbarStrings.AttemptingToReconnect : ToolbarStrings.Connecting,
Margin = new MarginPadding { Top = 10, Bottom = 10 },
},
},
};
@ -119,9 +120,9 @@ namespace osu.Game.Overlays.Login
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Left = 20, Right = 20 },
Padding = new MarginPadding { Horizontal = SettingsPanel.CONTENT_MARGINS },
Direction = FillDirection.Vertical,
Spacing = new Vector2(0f, 10f),
Spacing = new Vector2(0f, SettingsSection.ITEM_SPACING),
Children = new Drawable[]
{
new OsuSpriteText
@ -130,7 +131,6 @@ namespace osu.Game.Overlays.Login
Origin = Anchor.TopCentre,
Text = LoginPanelStrings.SignedIn,
Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold),
Margin = new MarginPadding { Top = 5, Bottom = 5 },
},
panel = new UserGridPanel(api.LocalUser.Value)
{

View File

@ -36,8 +36,6 @@ namespace osu.Game.Overlays.Login
Masking = true;
CornerRadius = 5;
Margin = new MarginPadding { Bottom = 5 };
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
@ -86,7 +84,6 @@ namespace osu.Game.Overlays.Login
public UserDropdownHeader()
{
Foreground.Padding = new MarginPadding { Left = 10, Right = 10 };
Margin = new MarginPadding { Bottom = 5 };
Masking = true;
CornerRadius = 5;
EdgeEffect = new EdgeEffectParameters

View File

@ -13,6 +13,7 @@ using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Cursor;
using osu.Game.Overlays.Login;
using osu.Game.Overlays.Settings;
namespace osu.Game.Overlays
{
@ -63,7 +64,7 @@ namespace osu.Game.Overlays
AutoSizeEasing = Easing.OutQuint,
Child = panel = new LoginPanel
{
Padding = new MarginPadding(10),
Padding = new MarginPadding { Vertical = SettingsSection.ITEM_SPACING },
RequestHide = Hide,
},
}