mirror of
https://github.com/ppy/osu.git
synced 2024-09-22 06:47:24 +08:00
Use BindValueChanged
This commit is contained in:
parent
c41b1e9eb4
commit
c55d237db6
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user