1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-07 05:07:21 +08:00

57 lines
1.6 KiB
C#
Raw Normal View History

2018-04-13 18:19:50 +09:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
2018-11-20 16:51:59 +09:00
using osuTK;
using osuTK.Graphics;
2018-04-13 18:19:50 +09:00
2018-11-06 18:28:22 +09:00
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
2018-04-13 18:19:50 +09:00
{
public class TimelineButton : CompositeDrawable
{
public Action Action;
public readonly BindableBool Enabled = new BindableBool(true);
public FontAwesome Icon
{
get { return button.Icon; }
set { button.Icon = value; }
}
private readonly IconButton button;
public TimelineButton()
{
2018-07-13 16:28:18 +09:00
InternalChild = button = new TimelineIconButton { Action = () => Action?.Invoke() };
2018-04-13 18:19:50 +09:00
button.Enabled.BindTo(Enabled);
Width = button.ButtonSize.X;
}
protected override void Update()
{
base.Update();
button.ButtonSize = new Vector2(button.ButtonSize.X, DrawHeight);
}
2018-07-13 16:28:18 +09:00
private class TimelineIconButton : IconButton
{
public TimelineIconButton()
{
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
IconColour = OsuColour.Gray(0.35f);
IconHoverColour = Color4.White;
HoverColour = OsuColour.Gray(0.25f);
FlashColour = OsuColour.Gray(0.5f);
}
}
2018-04-13 18:19:50 +09:00
}
}