1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +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)] [BackgroundDependencyLoader(permitNulls: true)]
private void load(OsuConfigManager config, AccountCreationOverlay accountCreation) private void load(OsuConfigManager config, AccountCreationOverlay accountCreation)
{ {
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FillDirection.Vertical; Direction = FillDirection.Vertical;
Spacing = new Vector2(0, SettingsSection.ITEM_SPACING); Spacing = new Vector2(0, SettingsSection.ITEM_SPACING);
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;
Padding = new MarginPadding
{
Top = 5,
Bottom = 24,
};
ErrorTextFlowContainer errorText; ErrorTextFlowContainer errorText;
LinkFlowContainer forgottenPasswordLink; LinkFlowContainer forgottenPasswordLink;
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuSpriteText new FillFlowContainer
{
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, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, 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 new SettingsCheckbox
{ {
@ -93,11 +100,7 @@ namespace osu.Game.Overlays.Login
}, },
forgottenPasswordLink = new LinkFlowContainer forgottenPasswordLink = new LinkFlowContainer
{ {
Padding = new MarginPadding Padding = new MarginPadding { Horizontal = SettingsPanel.CONTENT_MARGINS },
{
Left = SettingsPanel.CONTENT_MARGINS,
Bottom = SettingsSection.ITEM_SPACING
},
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
}, },

View File

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

View File

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

View File

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