Apply workaround at two levels

This commit is contained in:
Dean Herbert 2017-12-27 21:19:06 +09:00
parent 3428cf6501
commit 9a4b2f0d1d
1 changed files with 12 additions and 6 deletions

View File

@ -15,15 +15,11 @@
namespace osu.Game.Overlays.Notifications
{
public class NotificationSection : FillFlowContainer
public class NotificationSection : AlwaysUpdateFillFlowContainer<Drawable>
{
private OsuSpriteText titleText;
private OsuSpriteText countText;
// this is required to ensure correct layout and scheduling on children.
// the layout portion of this is being tracked as a framework issue (TODO).
protected override bool RequiresChildrenUpdate => true;
private ClearAllButton clearButton;
private FlowContainer<Notification> notifications;
@ -37,6 +33,7 @@ public class NotificationSection : FillFlowContainer
public IEnumerable<Type> AcceptTypes;
private string clearText;
public string ClearText
{
get { return clearText; }
@ -114,7 +111,7 @@ private void load(OsuColour colours)
},
},
},
notifications = new FillFlowContainer<Notification>
notifications = new AlwaysUpdateFillFlowContainer<Notification>
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
@ -163,4 +160,13 @@ public void MarkAllRead()
notifications?.Children.ForEach(n => n.Read = true);
}
}
public class AlwaysUpdateFillFlowContainer<T> : FillFlowContainer<T>
where T : Drawable
{
// this is required to ensure correct layout and scheduling on children.
// the layout portion of this is being tracked as a framework issue (https://github.com/ppy/osu-framework/issues/1297).
protected override bool RequiresChildrenUpdate => true;
}
}