mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Add a count of unread notifications to the toolbar
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user