mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 11:43:21 +08:00
Better structure for button layout.
This commit is contained in:
parent
7d2af9310b
commit
2c2a4169c6
@ -46,6 +46,8 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private Container dragContainer;
|
private Container dragContainer;
|
||||||
|
|
||||||
|
private const float progress_height = 10;
|
||||||
|
|
||||||
private const float bottom_black_area_height = 50;
|
private const float bottom_black_area_height = 50;
|
||||||
|
|
||||||
public MusicController()
|
public MusicController()
|
||||||
@ -117,14 +119,21 @@ namespace osu.Game.Overlays
|
|||||||
Text = @"Nothing to play",
|
Text = @"Nothing to play",
|
||||||
Font = @"Exo2.0-BoldItalic"
|
Font = @"Exo2.0-BoldItalic"
|
||||||
},
|
},
|
||||||
new FillFlowContainer<Button>
|
new Container {
|
||||||
{
|
Padding = new MarginPadding { Bottom = progress_height },
|
||||||
AutoSizeAxes = Axes.X,
|
|
||||||
Height = bottom_black_area_height,
|
Height = bottom_black_area_height,
|
||||||
Direction = FillDirection.Horizontal,
|
RelativeSizeAxes = Axes.X,
|
||||||
Spacing = new Vector2(5),
|
|
||||||
Origin = Anchor.BottomCentre,
|
Origin = Anchor.BottomCentre,
|
||||||
Anchor = 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[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
new Button
|
new Button
|
||||||
@ -134,7 +143,7 @@ namespace osu.Game.Overlays
|
|||||||
},
|
},
|
||||||
playButton = new Button
|
playButton = new Button
|
||||||
{
|
{
|
||||||
//Scale = new Vector2(1.4f),
|
//Scale = new Vector2(1.3f),
|
||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
if (current?.Track == null) return;
|
if (current?.Track == null) return;
|
||||||
@ -155,15 +164,17 @@ namespace osu.Game.Overlays
|
|||||||
new Button
|
new Button
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.CentreRight,
|
||||||
Position = new Vector2(-bottom_black_area_height / 2),
|
Position = new Vector2(-bottom_black_area_height / 2, 0),
|
||||||
Icon = FontAwesome.fa_bars,
|
Icon = FontAwesome.fa_bars,
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
progress = new DragBar
|
progress = new DragBar
|
||||||
{
|
{
|
||||||
Origin = Anchor.BottomCentre,
|
Origin = Anchor.BottomCentre,
|
||||||
Anchor = Anchor.BottomCentre,
|
Anchor = Anchor.BottomCentre,
|
||||||
Height = 10,
|
Height = progress_height,
|
||||||
Colour = colours.Yellow,
|
Colour = colours.Yellow,
|
||||||
SeekRequested = seek
|
SeekRequested = seek
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user