1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:52:53 +08:00

Make TimelineButtons combined take up the full height of the timeline

This commit is contained in:
smoogipoo 2017-10-12 18:32:39 +09:00
parent a6901c0a27
commit ab62390336
2 changed files with 15 additions and 3 deletions

View File

@ -79,17 +79,19 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
RelativeSizeAxes = Axes.Both,
Colour = OsuColour.FromHex("333")
},
new Container
new Container<TimelineButton>
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Padding = new MarginPadding { Vertical = 5 },
Masking = true,
Children = new[]
{
new TimelineButton
{
RelativeSizeAxes = Axes.Y,
Height = 0.5f,
Icon = FontAwesome.fa_search_plus,
Action = () => timelineContainer.Zoom++
},
@ -97,6 +99,8 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
RelativeSizeAxes = Axes.Y,
Height = 0.5f,
Icon = FontAwesome.fa_search_minus,
Action = () => timelineContainer.Zoom--
},

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
@ -38,7 +39,14 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
};
button.Enabled.BindTo(Enabled);
Size = button.ButtonSize;
Width = button.ButtonSize.X;
}
protected override void Update()
{
base.Update();
button.ButtonSize = new Vector2(button.ButtonSize.X, DrawHeight);
}
}
}