mirror of https://github.com/ppy/osu
Allow creating OnlineViewContainers with no placeholder button
This commit is contained in:
parent
a5a19319cc
commit
933c4010da
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue