1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-29 05:52:56 +08:00

Merge pull request #27278 from EVAST9919/grid-update

Apply padding to `GridContainer`s directly where possible
This commit is contained in:
Dean Herbert 2024-02-21 17:29:21 +08:00 committed by GitHub
commit 9c40ff2911
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 292 additions and 359 deletions

View File

@ -66,13 +66,10 @@ namespace osu.Game.Overlays.Chat.ChannelList
Colour = colourProvider.Background4, Colour = colourProvider.Background4,
Alpha = 0f, Alpha = 0f,
}, },
new Container new GridContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = 18, Right = 10 }, Padding = new MarginPadding { Left = 18, Right = 10 },
Child = new GridContainer
{
RelativeSizeAxes = Axes.Both,
ColumnDimensions = new[] ColumnDimensions = new[]
{ {
new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize),
@ -98,9 +95,8 @@ namespace osu.Game.Overlays.Chat.ChannelList
createMentionPill(), createMentionPill(),
close = createCloseButton(), close = createCloseButton(),
} }
}, }
}, }
},
}; };
Action = () => OnRequestSelect?.Invoke(Channel); Action = () => OnRequestSelect?.Invoke(Channel);

View File

@ -26,15 +26,11 @@ namespace osu.Game.Overlays.Profile.Header
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background5, Colour = colourProvider.Background5,
}, },
new Container new GridContainer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING, Vertical = 10 }, Padding = new MarginPadding { Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING, Vertical = 10 },
Child = new GridContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
RowDimensions = new[] RowDimensions = new[]
{ {
new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize),
@ -70,7 +66,6 @@ namespace osu.Game.Overlays.Profile.Header
} }
} }
} }
}
}; };
} }
} }

View File

@ -47,10 +47,7 @@ namespace osu.Game.Screens.Edit
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background4, Colour = colourProvider.Background4,
}, },
new Container new GridContainer
{
RelativeSizeAxes = Axes.Both,
Child = new GridContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
ColumnDimensions = new[] ColumnDimensions = new[]
@ -75,7 +72,6 @@ namespace osu.Game.Screens.Edit
} }
}, },
} }
},
} }
}; };
} }

View File

@ -86,10 +86,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background3 Colour = colourProvider.Background3
}, },
new Container new GridContainer
{
RelativeSizeAxes = Axes.Both,
Child = new GridContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Content = new[] Content = new[]
@ -118,19 +115,10 @@ namespace osu.Game.Screens.Edit.Compose.Components
} }
} }
} }
}
}, },
new Drawable[] new Drawable[]
{ {
new Container new GridContainer
{
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
new Container
{
RelativeSizeAxes = Axes.Both,
Child = new GridContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Content = new[] Content = new[]
@ -157,9 +145,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
new Dimension(GridSizeMode.Absolute, 20) new Dimension(GridSizeMode.Absolute, 20)
} }
} }
}
}
}
}, },
new Drawable[] new Drawable[]
{ {

View File

@ -57,16 +57,12 @@ namespace osu.Game.Screens.Edit
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background4 Colour = colourProvider.Background4
}, },
new Container new GridContainer
{ {
Name = "Timeline content", Name = "Timeline content",
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = PADDING, Top = PADDING }, Padding = new MarginPadding { Horizontal = PADDING, Top = PADDING },
Child = new GridContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Content = new[] Content = new[]
{ {
new Drawable[] new Drawable[]
@ -87,7 +83,6 @@ namespace osu.Game.Screens.Edit
new Dimension(), new Dimension(),
new Dimension(GridSizeMode.Absolute, 90), new Dimension(GridSizeMode.Absolute, 90),
} }
},
} }
} }
}, },

View File

@ -64,16 +64,11 @@ namespace osu.Game.Screens.Edit.Timing
Content = new[] Content = new[]
{ {
new Drawable[] new Drawable[]
{
new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding(padding),
Children = new Drawable[]
{ {
new GridContainer new GridContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding(padding),
ColumnDimensions = new[] ColumnDimensions = new[]
{ {
new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize),
@ -92,8 +87,6 @@ namespace osu.Game.Screens.Edit.Timing
} }
}, },
} }
}
},
}, },
new Drawable[] new Drawable[]
{ {

View File

@ -34,9 +34,6 @@ namespace osu.Game.Screens.Edit.Verify
InterpretedDifficulty.Default = StarDifficulty.GetDifficultyRating(EditorBeatmap.BeatmapInfo.StarRating); InterpretedDifficulty.Default = StarDifficulty.GetDifficultyRating(EditorBeatmap.BeatmapInfo.StarRating);
InterpretedDifficulty.SetDefault(); InterpretedDifficulty.SetDefault();
Child = new Container
{
RelativeSizeAxes = Axes.Both,
Child = new GridContainer Child = new GridContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
@ -53,7 +50,6 @@ namespace osu.Game.Screens.Edit.Verify
new IssueSettings(), new IssueSettings(),
}, },
} }
}
}; };
} }

View File

@ -26,18 +26,15 @@ namespace osu.Game.Screens.OnlinePlay.Components
[Resolved(typeof(Room))] [Resolved(typeof(Room))]
protected BindableList<PlaylistItem> Playlist { get; private set; } protected BindableList<PlaylistItem> Playlist { get; private set; }
private readonly Drawable playlistArea; private readonly GridContainer playlistArea;
private readonly DrawableRoomPlaylist playlist; private readonly DrawableRoomPlaylist playlist;
public MatchBeatmapDetailArea() public MatchBeatmapDetailArea()
{ {
Add(playlistArea = new Container Add(playlistArea = new GridContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Vertical = 10 }, Padding = new MarginPadding { Vertical = 10 },
Child = new GridContainer
{
RelativeSizeAxes = Axes.Both,
Content = new[] Content = new[]
{ {
new Drawable[] new Drawable[]
@ -68,7 +65,6 @@ namespace osu.Game.Screens.OnlinePlay.Components
new Dimension(), new Dimension(),
new Dimension(GridSizeMode.Absolute, 50), new Dimension(GridSizeMode.Absolute, 50),
} }
}
}); });
} }

View File

@ -40,15 +40,12 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
Colour = Color4.Black, Colour = Color4.Black,
Alpha = 0.5f Alpha = 0.5f
}, },
new Container new GridContainer
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Padding = new MarginPadding { Horizontal = padding }, Padding = new MarginPadding { Horizontal = padding },
Child = new GridContainer
{
AutoSizeAxes = Axes.Both,
ColumnDimensions = new[] ColumnDimensions = new[]
{ {
new Dimension(GridSizeMode.AutoSize, minSize: 80 - 2 * padding) new Dimension(GridSizeMode.AutoSize, minSize: 80 - 2 * padding)
@ -74,7 +71,6 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
} }
} }
} }
}
}; };
} }
} }

View File

@ -95,13 +95,10 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
new Drawable[] new Drawable[]
{ {
// Playlist items column // Playlist items column
new Container new GridContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Right = 5 }, Padding = new MarginPadding { Right = 5 },
Child = new GridContainer
{
RelativeSizeAxes = Axes.Both,
Content = new[] Content = new[]
{ {
new Drawable[] { new OverlinedPlaylistHeader(), }, new Drawable[] { new OverlinedPlaylistHeader(), },
@ -127,7 +124,6 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize),
new Dimension(), new Dimension(),
} }
}
}, },
// Spacer // Spacer
null, null,

View File

@ -150,13 +150,10 @@ namespace osu.Game.Screens.Ranking.Contracted
}, },
new Drawable[] new Drawable[]
{ {
new Container new GridContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Vertical = 5 }, Padding = new MarginPadding { Vertical = 5 },
Child = new GridContainer
{
RelativeSizeAxes = Axes.Both,
Content = new[] Content = new[]
{ {
new Drawable[] new Drawable[]
@ -189,7 +186,6 @@ namespace osu.Game.Screens.Ranking.Contracted
new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize),
} }
} }
}
}, },
}, },
RowDimensions = new[] RowDimensions = new[]

View File

@ -75,15 +75,10 @@ namespace osu.Game.Screens.Select
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = Colour4.Black.Opacity(0.3f), Colour = Colour4.Black.Opacity(0.3f),
}, },
new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Horizontal = spacing },
Children = new Drawable[]
{
new GridContainer new GridContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Horizontal = spacing },
RowDimensions = new[] RowDimensions = new[]
{ {
new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize),
@ -167,8 +162,6 @@ namespace osu.Game.Screens.Select
} }
} }
}, },
},
},
loading = new LoadingLayer(true) loading = new LoadingLayer(true)
}; };
} }