mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 22:42:57 +08:00
Cleanup
This commit is contained in:
parent
c173c4b7ee
commit
87b8015e8f
@ -22,22 +22,24 @@ namespace osu.Game.Graphics.UserInterface
|
||||
/// </summary>
|
||||
public class OsuTabControlCheckBox : CheckBox
|
||||
{
|
||||
private const float transition_length = 500;
|
||||
private Box box;
|
||||
private SpriteText text;
|
||||
private TextAwesome icon;
|
||||
|
||||
public event EventHandler<CheckBoxState> Action;
|
||||
|
||||
private Color4 accentColour;
|
||||
private Color4? accentColour;
|
||||
public Color4 AccentColour
|
||||
{
|
||||
get { return accentColour; }
|
||||
get { return accentColour.GetValueOrDefault(); }
|
||||
set
|
||||
{
|
||||
accentColour = value;
|
||||
|
||||
if (State == CheckBoxState.Unchecked)
|
||||
if (State != CheckBoxState.Checked)
|
||||
{
|
||||
text.Colour = accentColour;
|
||||
icon.Colour = accentColour;
|
||||
text.Colour = AccentColour;
|
||||
icon.Colour = AccentColour;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -48,22 +50,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
set { text.Text = value; }
|
||||
}
|
||||
|
||||
private Box box;
|
||||
private SpriteText text;
|
||||
private TextAwesome icon;
|
||||
|
||||
private void fadeIn()
|
||||
{
|
||||
box.FadeIn(transition_length, EasingTypes.OutQuint);
|
||||
text.FadeColour(Color4.White, transition_length, EasingTypes.OutQuint);
|
||||
}
|
||||
|
||||
private void fadeOut()
|
||||
{
|
||||
box.FadeOut(transition_length, EasingTypes.OutQuint);
|
||||
text.FadeColour(accentColour, transition_length, EasingTypes.OutQuint);
|
||||
}
|
||||
|
||||
protected override void OnChecked()
|
||||
{
|
||||
fadeIn();
|
||||
@ -78,6 +64,20 @@ namespace osu.Game.Graphics.UserInterface
|
||||
Action?.Invoke(this, State);
|
||||
}
|
||||
|
||||
private const float transition_length = 500;
|
||||
|
||||
private void fadeIn()
|
||||
{
|
||||
box.FadeIn(transition_length, EasingTypes.OutQuint);
|
||||
text.FadeColour(Color4.White, transition_length, EasingTypes.OutQuint);
|
||||
}
|
||||
|
||||
private void fadeOut()
|
||||
{
|
||||
box.FadeOut(transition_length, EasingTypes.OutQuint);
|
||||
text.FadeColour(AccentColour, transition_length, EasingTypes.OutQuint);
|
||||
}
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
fadeIn();
|
||||
@ -92,6 +92,13 @@ namespace osu.Game.Graphics.UserInterface
|
||||
base.OnHoverLost(state);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
if (accentColour == null)
|
||||
AccentColour = colours.Blue;
|
||||
}
|
||||
|
||||
public OsuTabControlCheckBox()
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
@ -9,19 +9,23 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
public class BeatmapDetailArea : Container
|
||||
{
|
||||
private Container content;
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
||||
public BeatmapDetailArea()
|
||||
{
|
||||
Children = new Drawable[]
|
||||
AddInternal(new Drawable[]
|
||||
{
|
||||
new BeatmapDetailAreaTabControl
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
},
|
||||
new Container
|
||||
content = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding { Top = BeatmapDetailAreaTabControl.HEIGHT },
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user