Refactor lounge sub screen layout for better loading screen appearance

This commit is contained in:
Salman Ahmed
2021-08-19 04:23:02 +03:00
parent 8172ffc401
commit ffbe8ddfa4

View File

@ -76,6 +76,8 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load([CanBeNull] IdleTracker idleTracker) private void load([CanBeNull] IdleTracker idleTracker)
{ {
const float controls_area_height = 25f;
if (idleTracker != null) if (idleTracker != null)
isIdle.BindTo(idleTracker.IsIdle); isIdle.BindTo(idleTracker.IsIdle);
@ -84,86 +86,69 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {
ListingPollingComponent = CreatePollingComponent().With(c => c.Filter.BindTarget = filter), ListingPollingComponent = CreatePollingComponent().With(c => c.Filter.BindTarget = filter),
new Container scrollContainer = new OsuScrollContainer
{ {
Name = @"Scrollable rooms container",
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding Padding = new MarginPadding
{ {
Left = WaveOverlayContainer.WIDTH_PADDING, Horizontal = WaveOverlayContainer.WIDTH_PADDING,
Right = WaveOverlayContainer.WIDTH_PADDING, Top = Header.HEIGHT + controls_area_height + 20,
}, },
Child = new GridContainer ScrollbarOverlapsContent = false,
Child = roomsContainer = new RoomsContainer
{ {
RelativeSizeAxes = Axes.Both, Filter = { BindTarget = filter }
RowDimensions = new[] }
},
loadingLayer = new LoadingLayer(true),
new FillFlowContainer
{
Name = @"Header area flow",
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = WaveOverlayContainer.WIDTH_PADDING },
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
new Container
{ {
new Dimension(GridSizeMode.Absolute, Header.HEIGHT), RelativeSizeAxes = Axes.X,
new Dimension(GridSizeMode.Absolute, 25), Height = Header.HEIGHT,
new Dimension(GridSizeMode.Absolute, 20) Child = searchTextBox = new LoungeSearchTextBox
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
RelativeSizeAxes = Axes.X,
Width = 0.6f,
},
}, },
Content = new[] new Container
{ {
new Drawable[] RelativeSizeAxes = Axes.X,
Height = controls_area_height,
Children = new Drawable[]
{ {
searchTextBox = new LoungeSearchTextBox Buttons.WithChild(CreateNewRoomButton().With(d =>
{ {
Anchor = Anchor.CentreRight, d.Anchor = Anchor.BottomLeft;
Origin = Anchor.CentreRight, d.Origin = Anchor.BottomLeft;
RelativeSizeAxes = Axes.X, d.Size = new Vector2(150, 37.5f);
Width = 0.6f, d.Action = () => Open();
}, })),
}, new FillFlowContainer
new Drawable[]
{
new Container
{ {
RelativeSizeAxes = Axes.Both, Anchor = Anchor.TopRight,
Depth = float.MinValue, // Contained filters should appear over the top of rooms. Origin = Anchor.TopRight,
Children = new Drawable[] AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(10),
ChildrenEnumerable = CreateFilterControls().Select(f => f.With(d =>
{ {
Buttons.WithChild(CreateNewRoomButton().With(d => d.Anchor = Anchor.TopRight;
{ d.Origin = Anchor.TopRight;
d.Anchor = Anchor.BottomLeft; }))
d.Origin = Anchor.BottomLeft;
d.Size = new Vector2(150, 37.5f);
d.Action = () => Open();
})),
new FillFlowContainer
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(10),
ChildrenEnumerable = CreateFilterControls().Select(f => f.With(d =>
{
d.Anchor = Anchor.TopRight;
d.Origin = Anchor.TopRight;
}))
}
}
} }
},
null,
new Drawable[]
{
new Container
{
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
scrollContainer = new OsuScrollContainer
{
RelativeSizeAxes = Axes.Both,
ScrollbarOverlapsContent = false,
Child = roomsContainer = new RoomsContainer
{
Filter = { BindTarget = filter }
}
},
loadingLayer = new LoadingLayer(true),
}
},
} }
} }
}, },