Small cleanups

This commit is contained in:
DrabWeb
2017-01-30 04:43:06 -04:00
parent d70cbd37dd
commit f8cbc35f8e
3 changed files with 64 additions and 56 deletions

View File

@ -24,50 +24,55 @@ namespace osu.Desktop.VisualTests.Tests
{
base.Reset();
Add(new Box
Children = new Drawable[]
{
ColourInfo = ColourInfo.GradientVertical(Color4.Gray, Color4.WhiteSmoke),
RelativeSizeAxes = Framework.Graphics.Axes.Both
});
new Box
{
ColourInfo = ColourInfo.GradientVertical(Color4.Gray, Color4.WhiteSmoke),
RelativeSizeAxes = Framework.Graphics.Axes.Both
},
pauseOverlay = new PauseOverlay
{
Depth = -1
},
new FlowContainer
{
RelativeSizeAxes = Axes.Both,
Origin = Anchor.TopLeft,
Anchor = Anchor.TopLeft,
Direction = FlowDirection.VerticalOnly,
Children = new Drawable[]
{
new Button
{
Text = @"Pause",
Anchor = Anchor.TopLeft,
Origin = Anchor.TopLeft,
Width = 100,
Height = 50,
Colour = Color4.Black,
Action = (() => pauseOverlay.Show())
},
new Button
{
Text = @"Add Retry",
Anchor = Anchor.TopLeft,
Origin = Anchor.TopLeft,
Width = 100,
Height = 50,
Colour = Color4.Black,
Action = (delegate {
retryCount++;
pauseOverlay.SetRetries(retryCount);
}),
}
}
}
};
Add(pauseOverlay = new PauseOverlay { Depth = -1 });
pauseOverlay.OnResume += (() => Logger.Log(@"Resume"));
pauseOverlay.OnRetry += (() => Logger.Log(@"Retry"));
pauseOverlay.OnQuit += (() => Logger.Log(@"Quit"));
Add(new FlowContainer
{
RelativeSizeAxes = Axes.Both,
Origin = Anchor.TopLeft,
Anchor = Anchor.TopLeft,
Direction = FlowDirection.VerticalOnly,
Children = new Drawable[]
{
new Button
{
Text = @"Pause",
Anchor = Anchor.TopLeft,
Origin = Anchor.TopLeft,
Width = 100,
Height = 50,
Colour = Color4.Black,
Action = (() => pauseOverlay.Show())
},
new Button
{
Text = @"Add Retry",
Anchor = Anchor.TopLeft,
Origin = Anchor.TopLeft,
Width = 100,
Height = 50,
Colour = Color4.Black,
Action = (delegate {
retryCount++;
pauseOverlay.SetRetries(retryCount);
}),
}
}
});
}
}
}