mirror of
https://github.com/ppy/osu
synced 2025-01-02 04:12:13 +00:00
Fix checkmark being hidden after clicking current waveform opacity setting
This commit is contained in:
parent
4828376439
commit
2fd0038154
@ -12,7 +12,7 @@ namespace osu.Game.Screens.Edit
|
||||
{
|
||||
private readonly Bindable<float> waveformOpacity;
|
||||
|
||||
private readonly Dictionary<float, ToggleMenuItem> menuItemLookup = new Dictionary<float, ToggleMenuItem>();
|
||||
private readonly Dictionary<float, TernaryStateRadioMenuItem> menuItemLookup = new Dictionary<float, TernaryStateRadioMenuItem>();
|
||||
|
||||
public WaveformOpacityMenuItem(Bindable<float> waveformOpacity)
|
||||
: base("Waveform opacity")
|
||||
@ -29,13 +29,13 @@ namespace osu.Game.Screens.Edit
|
||||
waveformOpacity.BindValueChanged(opacity =>
|
||||
{
|
||||
foreach (var kvp in menuItemLookup)
|
||||
kvp.Value.State.Value = kvp.Key == opacity.NewValue;
|
||||
kvp.Value.State.Value = kvp.Key == opacity.NewValue ? TernaryState.True : TernaryState.False;
|
||||
}, true);
|
||||
}
|
||||
|
||||
private ToggleMenuItem createMenuItem(float opacity)
|
||||
private TernaryStateRadioMenuItem createMenuItem(float opacity)
|
||||
{
|
||||
var item = new ToggleMenuItem($"{opacity * 100}%", MenuItemType.Standard, _ => updateOpacity(opacity));
|
||||
var item = new TernaryStateRadioMenuItem($"{opacity * 100}%", MenuItemType.Standard, _ => updateOpacity(opacity));
|
||||
menuItemLookup[opacity] = item;
|
||||
return item;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user