1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 19:35:15 +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,
Alpha = 0f,
},
new Container
new GridContainer
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = 18, Right = 10 },
Child = new GridContainer
{
RelativeSizeAxes = Axes.Both,
ColumnDimensions = new[]
{
new Dimension(GridSizeMode.AutoSize),
@ -98,9 +95,8 @@ namespace osu.Game.Overlays.Chat.ChannelList
createMentionPill(),
close = createCloseButton(),
}
},
},
},
}
}
};
Action = () => OnRequestSelect?.Invoke(Channel);

View File

@ -26,15 +26,11 @@ namespace osu.Game.Overlays.Profile.Header
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background5,
},
new Container
new GridContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING, Vertical = 10 },
Child = new GridContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
RowDimensions = new[]
{
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,
Colour = colourProvider.Background4,
},
new Container
{
RelativeSizeAxes = Axes.Both,
Child = new GridContainer
new GridContainer
{
RelativeSizeAxes = Axes.Both,
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,
Colour = colourProvider.Background3
},
new Container
{
RelativeSizeAxes = Axes.Both,
Child = new GridContainer
new GridContainer
{
RelativeSizeAxes = Axes.Both,
Content = new[]
@ -118,19 +115,10 @@ namespace osu.Game.Screens.Edit.Compose.Components
}
}
}
}
},
new Drawable[]
{
new Container
{
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
new Container
{
RelativeSizeAxes = Axes.Both,
Child = new GridContainer
new GridContainer
{
RelativeSizeAxes = Axes.Both,
Content = new[]
@ -157,9 +145,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
new Dimension(GridSizeMode.Absolute, 20)
}
}
}
}
}
},
new Drawable[]
{

View File

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

View File

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

View File

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

View File

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

View File

@ -40,15 +40,12 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
Colour = Color4.Black,
Alpha = 0.5f
},
new Container
new GridContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
AutoSizeAxes = Axes.Both,
Padding = new MarginPadding { Horizontal = padding },
Child = new GridContainer
{
AutoSizeAxes = Axes.Both,
ColumnDimensions = new[]
{
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[]
{
// Playlist items column
new Container
new GridContainer
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Right = 5 },
Child = new GridContainer
{
RelativeSizeAxes = Axes.Both,
Content = new[]
{
new Drawable[] { new OverlinedPlaylistHeader(), },
@ -127,7 +124,6 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
new Dimension(GridSizeMode.AutoSize),
new Dimension(),
}
}
},
// Spacer
null,

View File

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

View File

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