mirror of https://github.com/ppy/osu
Expose `Expanded` state of `BeatmapCardContent` as read-only bindable
This is just to reduce complexity of these interactions by ensuring that the expanded state can only be changed by the class itself.
This commit is contained in:
parent
e9187cc3cf
commit
41e6c24dad
|
@ -31,7 +31,9 @@ public Drawable ExpandedContent
|
|||
set => dropdownScroll.Child = value;
|
||||
}
|
||||
|
||||
public Bindable<bool> Expanded { get; } = new BindableBool();
|
||||
public IBindable<bool> Expanded => expanded;
|
||||
|
||||
private readonly BindableBool expanded = new BindableBool();
|
||||
|
||||
private readonly Box background;
|
||||
private readonly Container content;
|
||||
|
@ -128,7 +130,7 @@ public void ScheduleShow()
|
|||
scheduledExpandedChange = Scheduler.AddDelayed(() =>
|
||||
{
|
||||
if (!Expanded.Disabled)
|
||||
Expanded.Value = true;
|
||||
expanded.Value = true;
|
||||
}, 100);
|
||||
}
|
||||
|
||||
|
@ -141,7 +143,7 @@ public void ScheduleHide()
|
|||
scheduledExpandedChange = Scheduler.AddDelayed(() =>
|
||||
{
|
||||
if (!Expanded.Disabled)
|
||||
Expanded.Value = false;
|
||||
expanded.Value = false;
|
||||
}, 500);
|
||||
}
|
||||
|
||||
|
@ -154,7 +156,7 @@ private void checkForHide()
|
|||
return;
|
||||
|
||||
scheduledExpandedChange?.Cancel();
|
||||
Expanded.Value = false;
|
||||
expanded.Value = false;
|
||||
}
|
||||
|
||||
private void keep()
|
||||
|
@ -163,7 +165,7 @@ private void keep()
|
|||
return;
|
||||
|
||||
scheduledExpandedChange?.Cancel();
|
||||
Expanded.Value = true;
|
||||
expanded.Value = true;
|
||||
}
|
||||
|
||||
private void updateState()
|
||||
|
|
Loading…
Reference in New Issue