Better structure for button layout.

This commit is contained in:
Dean Herbert 2017-04-07 15:28:18 +09:00
parent 7d2af9310b
commit 2c2a4169c6
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
1 changed files with 42 additions and 31 deletions

View File

@ -46,6 +46,8 @@ public class MusicController : FocusedOverlayContainer
private Container dragContainer;
private const float progress_height = 10;
private const float bottom_black_area_height = 50;
public MusicController()
@ -117,14 +119,21 @@ private void load(OsuGameBase game, OsuConfigManager config, BeatmapDatabase bea
Text = @"Nothing to play",
Font = @"Exo2.0-BoldItalic"
},
new FillFlowContainer<Button>
{
AutoSizeAxes = Axes.X,
new Container {
Padding = new MarginPadding { Bottom = progress_height },
Height = bottom_black_area_height,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(5),
RelativeSizeAxes = Axes.X,
Origin = Anchor.BottomCentre,
Anchor = Anchor.BottomCentre,
Children = new Drawable[]
{
new FillFlowContainer<Button>
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(5),
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Children = new[]
{
new Button
@ -134,7 +143,7 @@ private void load(OsuGameBase game, OsuConfigManager config, BeatmapDatabase bea
},
playButton = new Button
{
//Scale = new Vector2(1.4f),
//Scale = new Vector2(1.3f),
Action = () =>
{
if (current?.Track == null) return;
@ -155,15 +164,17 @@ private void load(OsuGameBase game, OsuConfigManager config, BeatmapDatabase bea
new Button
{
Origin = Anchor.Centre,
Anchor = Anchor.BottomRight,
Position = new Vector2(-bottom_black_area_height / 2),
Anchor = Anchor.CentreRight,
Position = new Vector2(-bottom_black_area_height / 2, 0),
Icon = FontAwesome.fa_bars,
},
}
},
progress = new DragBar
{
Origin = Anchor.BottomCentre,
Anchor = Anchor.BottomCentre,
Height = 10,
Height = progress_height,
Colour = colours.Yellow,
SeekRequested = seek
}