// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; namespace osu.Game.Graphics.UserInterface { /// /// An which displays an enabled or disabled state. /// public class ToggleMenuItem : StatefulMenuItem { /// /// Creates a new . /// /// The text to display. /// The type of action which this performs. public ToggleMenuItem(LocalisableString text, MenuItemType type = MenuItemType.Standard) : this(text, type, null) { } /// /// Creates a new . /// /// The text to display. /// The type of action which this performs. /// A delegate to be invoked when this is pressed. public ToggleMenuItem(LocalisableString text, MenuItemType type, Action? action) : base(text, value => !value, type, action) { } public override IconUsage? GetIconForState(bool state) => state ? FontAwesome.Solid.Check : null; } }