Allow creating OnlineViewContainers with no placeholder button

This commit is contained in:
Dean Herbert 2021-04-06 16:17:20 +09:00
parent a5a19319cc
commit 933c4010da
1 changed files with 7 additions and 3 deletions

View File

@ -23,13 +23,17 @@ public class OnlineViewContainer : Container
private readonly string placeholderMessage;
private Placeholder placeholder;
private Drawable placeholder;
private const double transform_duration = 300;
[Resolved]
protected IAPIProvider API { get; private set; }
/// <summary>
/// Construct a new instance of an online view container.
/// </summary>
/// <param name="placeholderMessage">The message to display when not logged in. If empty, no button will display.</param>
public OnlineViewContainer(string placeholderMessage)
{
this.placeholderMessage = placeholderMessage;
@ -40,10 +44,10 @@ public OnlineViewContainer(string placeholderMessage)
[BackgroundDependencyLoader]
private void load(IAPIProvider api)
{
InternalChildren = new Drawable[]
InternalChildren = new[]
{
Content,
placeholder = new LoginPlaceholder(placeholderMessage),
placeholder = string.IsNullOrEmpty(placeholderMessage) ? Empty() : new LoginPlaceholder(placeholderMessage),
LoadingSpinner = new LoadingSpinner
{
Alpha = 0,