1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 10:42:54 +08:00

only show warning when focused

This commit is contained in:
Jorolf 2017-08-25 16:39:49 +02:00
parent 26323caf6f
commit 9374bf925e

View File

@ -44,10 +44,24 @@ namespace osu.Game.Graphics.UserInterface
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
if (args.Key == OpenTK.Input.Key.CapsLock)
warning.FadeTo(host.CapsLockEnabled ? 1 : 0, 250, Easing.OutQuint);
updateCapsWarning(host.CapsLockEnabled);
return base.OnKeyDown(state, args);
}
protected override void OnFocus(InputState state)
{
updateCapsWarning(host.CapsLockEnabled);
base.OnFocus(state);
}
protected override void OnFocusLost(InputState state)
{
updateCapsWarning(false);
base.OnFocusLost(state);
}
private void updateCapsWarning(bool visible) => warning.FadeTo(visible ? 1 : 0, 250, Easing.OutQuint);
public class PasswordMaskChar : Container
{
private readonly CircularContainer circle;