1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 09:43:10 +08:00

Update UI controls to understand DisabledChanged.

This commit is contained in:
Dean Herbert 2017-04-21 13:53:11 +09:00
parent 2d53ad4c0a
commit ef7bc0f92e
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
6 changed files with 21 additions and 9 deletions

View File

@ -25,8 +25,6 @@ namespace osu.Game.Graphics.UserInterface
{
bindable = value;
Current.BindTo(bindable);
if (value?.Disabled ?? true)
Alpha = 0.3f;
}
}
@ -84,6 +82,11 @@ namespace osu.Game.Graphics.UserInterface
else
sampleUnchecked?.Play();
};
Current.DisabledChanged += disabled =>
{
Alpha = disabled ? 0.3f : 1;
};
}
protected override bool OnHover(InputState state)

View File

@ -74,6 +74,11 @@ namespace osu.Game.Graphics.UserInterface
Expanded = true,
}
};
Current.DisabledChanged += disabled =>
{
Alpha = disabled ? 0.3f : 1;
};
}
[BackgroundDependencyLoader]

View File

@ -33,6 +33,11 @@ namespace osu.Game.Graphics.UserInterface
Height = 40;
TextContainer.Height = 0.5f;
CornerRadius = 5;
Current.DisabledChanged += disabled =>
{
Alpha = disabled ? 0.3f : 1;
};
}
[BackgroundDependencyLoader]

View File

@ -34,8 +34,6 @@ namespace osu.Game.Overlays.Options
{
bindable = value;
dropdown.Current.BindTo(bindable);
if (value?.Disabled ?? true)
Alpha = 0.3f;
}
}
@ -75,6 +73,11 @@ namespace osu.Game.Overlays.Options
Items = Items,
}
};
dropdown.Current.DisabledChanged += disabled =>
{
Alpha = disabled ? 0.3f : 1;
};
}
}
}

View File

@ -35,8 +35,6 @@ namespace osu.Game.Overlays.Options
{
bindable = value;
slider.Current.BindTo(bindable);
if (value?.Disabled ?? true)
Alpha = 0.3f;
}
}

View File

@ -16,9 +16,7 @@ namespace osu.Game.Overlays.Options
{
bindable = value;
Current.BindTo(bindable);
if (value?.Disabled ?? true)
Alpha = 0.3f;
}
}
}
}
}