Simplify content creation of Timeline / TimelineArea

This commit is contained in:
Dean Herbert
2021-04-14 20:55:12 +09:00
parent be08b9d1ef
commit d1c68cb92b
3 changed files with 19 additions and 15 deletions

View File

@ -12,11 +12,19 @@ using osuTK;
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
public class TimelineArea : Container
public class TimelineArea : CompositeDrawable
{
public readonly Timeline Timeline = new Timeline();
public Timeline Timeline;
protected override Container<Drawable> Content => Timeline;
private readonly Drawable userContent;
public TimelineArea(Drawable content = null)
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
userContent = content ?? Drawable.Empty();
}
[BackgroundDependencyLoader]
private void load()
@ -122,7 +130,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
}
}
},
Timeline
Timeline = new Timeline(userContent),
},
},
RowDimensions = new[]