1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 04:42:58 +08:00

Merge pull request #23103 from Joehuu/normalise-overlay-padding

Normalise horizontal padding on overlays
This commit is contained in:
Dean Herbert 2023-04-10 23:48:59 +09:00 committed by GitHub
commit 52c4703261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 44 additions and 46 deletions

View File

@ -107,7 +107,7 @@ namespace osu.Game.Overlays.BeatmapListing
Padding = new MarginPadding Padding = new MarginPadding
{ {
Vertical = 20, Vertical = 20,
Horizontal = 40, Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING,
}, },
Child = new FillFlowContainer Child = new FillFlowContainer
{ {

View File

@ -97,8 +97,8 @@ namespace osu.Game.Overlays.BeatmapSet
Padding = new MarginPadding Padding = new MarginPadding
{ {
Vertical = BeatmapSetOverlay.Y_PADDING, Vertical = BeatmapSetOverlay.Y_PADDING,
Left = BeatmapSetOverlay.X_PADDING, Left = WaveOverlayContainer.HORIZONTAL_PADDING,
Right = BeatmapSetOverlay.X_PADDING + BeatmapSetOverlay.RIGHT_WIDTH, Right = WaveOverlayContainer.HORIZONTAL_PADDING + BeatmapSetOverlay.RIGHT_WIDTH,
}, },
Children = new Drawable[] Children = new Drawable[]
{ {
@ -170,7 +170,7 @@ namespace osu.Game.Overlays.BeatmapSet
Anchor = Anchor.BottomRight, Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight, Origin = Anchor.BottomRight,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Top = BeatmapSetOverlay.Y_PADDING, Right = BeatmapSetOverlay.X_PADDING }, Margin = new MarginPadding { Top = BeatmapSetOverlay.Y_PADDING, Right = WaveOverlayContainer.HORIZONTAL_PADDING },
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Spacing = new Vector2(10), Spacing = new Vector2(10),
Children = new Drawable[] Children = new Drawable[]

View File

@ -55,7 +55,7 @@ namespace osu.Game.Overlays.BeatmapSet
new Container new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Top = 15, Horizontal = BeatmapSetOverlay.X_PADDING }, Padding = new MarginPadding { Top = 15, Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING },
Children = new Drawable[] Children = new Drawable[]
{ {
new Container new Container

View File

@ -116,7 +116,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Padding = new MarginPadding { Horizontal = 50 }, Padding = new MarginPadding { Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING },
Margin = new MarginPadding { Vertical = 20 }, Margin = new MarginPadding { Vertical = 20 },
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -25,7 +25,6 @@ namespace osu.Game.Overlays
{ {
public partial class BeatmapSetOverlay : OnlineOverlay<BeatmapSetHeader> public partial class BeatmapSetOverlay : OnlineOverlay<BeatmapSetHeader>
{ {
public const float X_PADDING = 40;
public const float Y_PADDING = 25; public const float Y_PADDING = 25;
public const float RIGHT_WIDTH = 275; public const float RIGHT_WIDTH = 275;

View File

@ -18,8 +18,6 @@ namespace osu.Game.Overlays.Changelog
{ {
public partial class ChangelogBuild : FillFlowContainer public partial class ChangelogBuild : FillFlowContainer
{ {
public const float HORIZONTAL_PADDING = 70;
public Action<APIChangelogBuild> SelectBuild; public Action<APIChangelogBuild> SelectBuild;
protected readonly APIChangelogBuild Build; protected readonly APIChangelogBuild Build;
@ -33,7 +31,7 @@ namespace osu.Game.Overlays.Changelog
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Direction = FillDirection.Vertical; Direction = FillDirection.Vertical;
Padding = new MarginPadding { Horizontal = HORIZONTAL_PADDING }; Padding = new MarginPadding { Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING };
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -93,7 +93,7 @@ namespace osu.Game.Overlays.Changelog
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Padding = new MarginPadding Padding = new MarginPadding
{ {
Horizontal = 65, Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING - ChangelogUpdateStreamItem.PADDING,
Vertical = 20 Vertical = 20
}, },
Child = Streams = new ChangelogUpdateStreamControl { Current = currentStream }, Child = Streams = new ChangelogUpdateStreamControl { Current = currentStream },

View File

@ -64,7 +64,7 @@ namespace osu.Game.Overlays.Changelog
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Height = 1, Height = 1,
Padding = new MarginPadding { Horizontal = ChangelogBuild.HORIZONTAL_PADDING }, Padding = new MarginPadding { Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING },
Margin = new MarginPadding { Top = 30 }, Margin = new MarginPadding { Top = 30 },
Child = new Box Child = new Box
{ {

View File

@ -34,7 +34,7 @@ namespace osu.Game.Overlays.Changelog
Padding = new MarginPadding Padding = new MarginPadding
{ {
Vertical = 20, Vertical = 20,
Horizontal = 50, Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING,
}; };
} }
@ -79,7 +79,7 @@ namespace osu.Game.Overlays.Changelog
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Padding = new MarginPadding { Right = 50 + image_container_width }, Padding = new MarginPadding { Right = WaveOverlayContainer.HORIZONTAL_PADDING + image_container_width },
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuSpriteText new OsuSpriteText

View File

@ -99,7 +99,7 @@ namespace osu.Game.Overlays.Comments
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = 50, Vertical = 20 }, Padding = new MarginPadding { Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING, Vertical = 20 },
Children = new Drawable[] Children = new Drawable[]
{ {
avatar = new UpdateableAvatar(api.LocalUser.Value) avatar = new UpdateableAvatar(api.LocalUser.Value)
@ -152,7 +152,7 @@ namespace osu.Game.Overlays.Comments
ShowDeleted = { BindTarget = ShowDeleted }, ShowDeleted = { BindTarget = ShowDeleted },
Margin = new MarginPadding Margin = new MarginPadding
{ {
Horizontal = 70, Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING,
Vertical = 10 Vertical = 10
} }
}, },
@ -393,7 +393,7 @@ namespace osu.Game.Overlays.Comments
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Margin = new MarginPadding { Left = 50 }, Margin = new MarginPadding { Left = WaveOverlayContainer.HORIZONTAL_PADDING },
Text = CommentsStrings.Empty Text = CommentsStrings.Empty
} }
}); });

View File

@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Comments
new Container new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Horizontal = 50 }, Padding = new MarginPadding { Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING },
Children = new Drawable[] Children = new Drawable[]
{ {
new OverlaySortTabControl<CommentsSortCriteria> new OverlaySortTabControl<CommentsSortCriteria>

View File

@ -537,7 +537,7 @@ namespace osu.Game.Overlays.Comments
{ {
return new MarginPadding return new MarginPadding
{ {
Horizontal = 70, Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING,
Vertical = 15 Vertical = 15
}; };
} }

View File

@ -32,7 +32,7 @@ namespace osu.Game.Overlays.Comments
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Margin = new MarginPadding { Left = 50 }, Margin = new MarginPadding { Left = WaveOverlayContainer.HORIZONTAL_PADDING },
Spacing = new Vector2(5, 0), Spacing = new Vector2(5, 0),
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Dashboard
new Container<BasicSearchTextBox> new Container<BasicSearchTextBox>
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Padding = new MarginPadding(padding), Padding = new MarginPadding { Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING, Vertical = padding },
Child = searchTextBox = new BasicSearchTextBox Child = searchTextBox = new BasicSearchTextBox
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,

View File

@ -79,7 +79,7 @@ namespace osu.Game.Overlays.Dashboard.Friends
Padding = new MarginPadding Padding = new MarginPadding
{ {
Top = 20, Top = 20,
Horizontal = 45 Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING - FriendsOnlineStatusItem.PADDING
}, },
Child = onlineStreamControl = new FriendOnlineStreamControl(), Child = onlineStreamControl = new FriendOnlineStreamControl(),
} }
@ -129,7 +129,7 @@ namespace osu.Game.Overlays.Dashboard.Friends
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = 50 } Padding = new MarginPadding { Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING }
}, },
loading = new LoadingLayer(true) loading = new LoadingLayer(true)
} }

View File

@ -43,7 +43,7 @@ namespace osu.Game.Overlays.News.Displays
{ {
Vertical = 20, Vertical = 20,
Left = 30, Left = 30,
Right = 50 Right = WaveOverlayContainer.HORIZONTAL_PADDING
}; };
InternalChild = new FillFlowContainer InternalChild = new FillFlowContainer

View File

@ -89,7 +89,7 @@ namespace osu.Game.Overlays
} }
}); });
ContentSidePadding = 50; ContentSidePadding = WaveOverlayContainer.HORIZONTAL_PADDING;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]

View File

@ -55,7 +55,7 @@ namespace osu.Game.Overlays
Padding = new MarginPadding Padding = new MarginPadding
{ {
Vertical = 20, Vertical = 20,
Left = 50, Left = WaveOverlayContainer.HORIZONTAL_PADDING,
Right = 30 Right = 30
}, },
Child = CreateContent() Child = CreateContent()

View File

@ -39,12 +39,14 @@ namespace osu.Game.Overlays
private FillFlowContainer<SpriteText> text; private FillFlowContainer<SpriteText> text;
private ExpandingBar expandingBar; private ExpandingBar expandingBar;
public const float PADDING = 5;
protected OverlayStreamItem(T value) protected OverlayStreamItem(T value)
: base(value) : base(value)
{ {
Height = 50; Height = 50;
Width = 90; Width = 90;
Margin = new MarginPadding(5); Margin = new MarginPadding(PADDING);
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]

View File

@ -50,7 +50,7 @@ namespace osu.Game.Overlays.Profile.Header
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Spacing = new Vector2(10, 10), Spacing = new Vector2(10, 10),
Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, Top = 10 }, Padding = new MarginPadding { Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING, Top = 10 },
} }
}; };
} }

View File

@ -55,7 +55,7 @@ namespace osu.Game.Overlays.Profile.Header
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, Vertical = 10 }, Padding = new MarginPadding { Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING, Vertical = 10 },
Spacing = new Vector2(0, 10), Spacing = new Vector2(0, 10),
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -39,7 +39,7 @@ namespace osu.Game.Overlays.Profile.Header
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Padding = new MarginPadding { Vertical = 10 }, Padding = new MarginPadding { Vertical = 10 },
Margin = new MarginPadding { Left = UserProfileOverlay.CONTENT_X_MARGIN }, Margin = new MarginPadding { Left = WaveOverlayContainer.HORIZONTAL_PADDING },
Spacing = new Vector2(10, 0), Spacing = new Vector2(10, 0),
Children = new Drawable[] Children = new Drawable[]
{ {
@ -62,7 +62,7 @@ namespace osu.Game.Overlays.Profile.Header
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Right = UserProfileOverlay.CONTENT_X_MARGIN }, Margin = new MarginPadding { Right = WaveOverlayContainer.HORIZONTAL_PADDING },
Children = new Drawable[] Children = new Drawable[]
{ {
levelBadge = new LevelBadge levelBadge = new LevelBadge
@ -77,7 +77,7 @@ namespace osu.Game.Overlays.Profile.Header
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
Width = 200, Width = 200,
Height = 6, Height = 6,
Margin = new MarginPadding { Right = 50 }, Margin = new MarginPadding { Right = WaveOverlayContainer.HORIZONTAL_PADDING },
Child = new LevelProgressBar Child = new LevelProgressBar
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,

View File

@ -30,7 +30,7 @@ namespace osu.Game.Overlays.Profile.Header
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, Vertical = 10 }, Padding = new MarginPadding { Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING, Vertical = 10 },
Child = new GridContainer Child = new GridContainer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,

View File

@ -83,7 +83,7 @@ namespace osu.Game.Overlays.Profile.Header
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Padding = new MarginPadding Padding = new MarginPadding
{ {
Left = UserProfileOverlay.CONTENT_X_MARGIN, Left = WaveOverlayContainer.HORIZONTAL_PADDING,
Vertical = vertical_padding Vertical = vertical_padding
}, },
Height = content_height + 2 * vertical_padding, Height = content_height + 2 * vertical_padding,

View File

@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Profile
public ProfileHeader() public ProfileHeader()
{ {
ContentSidePadding = UserProfileOverlay.CONTENT_X_MARGIN; ContentSidePadding = WaveOverlayContainer.HORIZONTAL_PADDING;
TabControl.AddItem(LayoutStrings.HeaderUsersShow); TabControl.AddItem(LayoutStrings.HeaderUsersShow);

View File

@ -67,7 +67,7 @@ namespace osu.Game.Overlays.Profile
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Margin = new MarginPadding Margin = new MarginPadding
{ {
Horizontal = UserProfileOverlay.CONTENT_X_MARGIN - outer_gutter_width, Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING - outer_gutter_width,
Top = 20, Top = 20,
Bottom = 20, Bottom = 20,
}, },
@ -97,7 +97,7 @@ namespace osu.Game.Overlays.Profile
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Padding = new MarginPadding Padding = new MarginPadding
{ {
Horizontal = UserProfileOverlay.CONTENT_X_MARGIN - outer_gutter_width, Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING - outer_gutter_width,
Bottom = 20 Bottom = 20
} }
}, },

View File

@ -54,7 +54,7 @@ namespace osu.Game.Overlays.Rankings
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Spacing = new Vector2(10, 0), Spacing = new Vector2(10, 0),
Margin = new MarginPadding { Left = UserProfileOverlay.CONTENT_X_MARGIN }, Margin = new MarginPadding { Left = WaveOverlayContainer.HORIZONTAL_PADDING },
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuSpriteText new OsuSpriteText

View File

@ -63,7 +63,7 @@ namespace osu.Game.Overlays.Rankings
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN }, Padding = new MarginPadding { Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING },
Child = new FillFlowContainer Child = new FillFlowContainer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,

View File

@ -23,7 +23,6 @@ namespace osu.Game.Overlays.Rankings.Tables
public abstract partial class RankingsTable<TModel> : TableContainer public abstract partial class RankingsTable<TModel> : TableContainer
{ {
protected const int TEXT_SIZE = 12; protected const int TEXT_SIZE = 12;
private const float horizontal_inset = 20;
private const float row_height = 32; private const float row_height = 32;
private const float row_spacing = 3; private const float row_spacing = 3;
private const int items_per_page = 50; private const int items_per_page = 50;
@ -39,7 +38,7 @@ namespace osu.Game.Overlays.Rankings.Tables
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Padding = new MarginPadding { Horizontal = horizontal_inset }; Padding = new MarginPadding { Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING };
RowSize = new Dimension(GridSizeMode.Absolute, row_height + row_spacing); RowSize = new Dimension(GridSizeMode.Absolute, row_height + row_spacing);
} }

View File

@ -45,8 +45,6 @@ namespace osu.Game.Overlays
[Resolved] [Resolved]
private RulesetStore rulesets { get; set; } = null!; private RulesetStore rulesets { get; set; } = null!;
public const float CONTENT_X_MARGIN = 50;
public UserProfileOverlay() public UserProfileOverlay()
: base(OverlayColourScheme.Pink) : base(OverlayColourScheme.Pink)
{ {
@ -184,7 +182,7 @@ namespace osu.Game.Overlays
public ProfileSectionTabControl() public ProfileSectionTabControl()
{ {
Height = 40; Height = 40;
Padding = new MarginPadding { Horizontal = CONTENT_X_MARGIN }; Padding = new MarginPadding { Horizontal = HORIZONTAL_PADDING };
TabContainer.Spacing = new Vector2(20); TabContainer.Spacing = new Vector2(20);
} }

View File

@ -22,6 +22,8 @@ namespace osu.Game.Overlays
protected override string PopInSampleName => "UI/wave-pop-in"; protected override string PopInSampleName => "UI/wave-pop-in";
public const float HORIZONTAL_PADDING = 50;
protected WaveOverlayContainer() protected WaveOverlayContainer()
{ {
AddInternal(Waves = new WaveContainer AddInternal(Waves = new WaveContainer

View File

@ -56,7 +56,7 @@ namespace osu.Game.Overlays.Wiki
{ {
Vertical = 20, Vertical = 20,
Left = 30, Left = 30,
Right = 50, Right = WaveOverlayContainer.HORIZONTAL_PADDING,
}, },
OnAddHeading = sidebar.AddEntry, OnAddHeading = sidebar.AddEntry,
} }

View File

@ -145,7 +145,7 @@ namespace osu.Game.Overlays
Padding = new MarginPadding Padding = new MarginPadding
{ {
Vertical = 20, Vertical = 20,
Horizontal = 50, Horizontal = HORIZONTAL_PADDING,
}, },
}); });
} }