1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 06:47:24 +08:00

Use BindValueChanged

This commit is contained in:
Dean Herbert 2019-08-23 17:42:40 +09:00
parent c41b1e9eb4
commit c55d237db6

View File

@ -68,14 +68,12 @@ namespace osu.Game.Overlays.Volume
} }
}); });
Current.ValueChanged += muted => Current.BindValueChanged(muted =>
{ {
icon.Icon = muted.NewValue ? FontAwesome.Solid.VolumeMute : FontAwesome.Solid.VolumeUp; icon.Icon = muted.NewValue ? FontAwesome.Solid.VolumeMute : FontAwesome.Solid.VolumeUp;
icon.Size = new Vector2(muted.NewValue ? 18 : 20); icon.Size = new Vector2(muted.NewValue ? 18 : 20);
icon.Margin = new MarginPadding { Right = muted.NewValue ? 2 : 0 }; icon.Margin = new MarginPadding { Right = muted.NewValue ? 2 : 0 };
}; }, true);
Current.TriggerChange();
} }
protected override bool OnHover(HoverEvent e) protected override bool OnHover(HoverEvent e)