Add a count of unread notifications to the toolbar

This commit is contained in:
Dean Herbert
2017-12-26 01:36:58 +09:00
parent dff082ed94
commit bb33d0211a
2 changed files with 79 additions and 1 deletions

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Graphics.Containers;
using osu.Game.Overlays.Toolbar;
@ -15,11 +16,24 @@ namespace osu.Game.Tests.Visual
typeof(ToolbarButton),
typeof(ToolbarModeSelector),
typeof(ToolbarModeButton),
typeof(ToolbarNotificationButton),
};
public TestCaseToolbar()
{
Add(new Toolbar { State = Visibility.Visible });
var toolbar = new Toolbar { State = Visibility.Visible };
Add(toolbar);
var notificationButton = toolbar.Children.OfType<FillFlowContainer>().Last().Children.OfType<ToolbarNotificationButton>().First();
void setNotifications(int count) => AddStep($"set notification count to {count}", () => notificationButton.NotificationCount.Value = count);
setNotifications(1);
setNotifications(2);
setNotifications(3);
setNotifications(0);
setNotifications(144);
}
}
}