Merge branch 'master' into general-fixes

This commit is contained in:
Dean Herbert
2017-02-15 01:14:25 +09:00
committed by GitHub
7 changed files with 178 additions and 154 deletions

View File

@ -32,10 +32,15 @@ namespace osu.Game.Graphics.UserInterface
Font = @"Exo2.0-Bold",
};
public override bool HandleInput => Action != null;
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.BlueDark;
if (Action == null)
Colour = OsuColour.Gray(0.5f);
BackgroundColour = colours.BlueDark;
Content.Masking = true;
Content.CornerRadius = 5;

View File

@ -39,6 +39,9 @@ namespace osu.Game.Graphics.UserInterface
State = bindable.Value ? CheckBoxState.Checked : CheckBoxState.Unchecked;
bindable.ValueChanged += bindableValueChanged;
}
if (bindable?.Disabled ?? true)
Alpha = 0.3f;
}
}
@ -123,20 +126,20 @@ namespace osu.Game.Graphics.UserInterface
protected override void OnChecked()
{
if (bindable != null)
bindable.Value = true;
sampleChecked?.Play();
nub.State = CheckBoxState.Checked;
if (bindable != null)
bindable.Value = true;
}
protected override void OnUnchecked()
{
if (bindable != null)
bindable.Value = false;
sampleUnchecked?.Play();
nub.State = CheckBoxState.Unchecked;
if (bindable != null)
bindable.Value = false;
}
}
}