2019-10-09 16:07:56 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Bindables;
|
2020-02-10 20:43:11 +08:00
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
using osu.Game.Graphics;
|
2019-10-09 16:07:56 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Comments
|
|
|
|
|
{
|
2019-10-15 05:32:21 +08:00
|
|
|
|
public abstract class ShowChildrenButton : OsuHoverContainer
|
2019-10-09 16:07:56 +08:00
|
|
|
|
{
|
|
|
|
|
public readonly BindableBool Expanded = new BindableBool(true);
|
|
|
|
|
|
2019-10-15 05:32:21 +08:00
|
|
|
|
protected ShowChildrenButton()
|
2019-10-09 16:07:56 +08:00
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both;
|
2020-02-10 20:43:11 +08:00
|
|
|
|
IdleColour = OsuColour.Gray(0.7f);
|
|
|
|
|
HoverColour = Color4.White;
|
2019-10-09 16:07:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
2020-02-10 20:43:11 +08:00
|
|
|
|
Action = Expanded.Toggle;
|
|
|
|
|
|
2019-10-09 16:07:56 +08:00
|
|
|
|
Expanded.BindValueChanged(OnExpandedChanged, true);
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected abstract void OnExpandedChanged(ValueChangedEvent<bool> expanded);
|
|
|
|
|
}
|
|
|
|
|
}
|