Make tab background opaque when chat is fullscreen

This commit is contained in:
Dean Herbert
2017-05-12 19:15:04 +09:00
parent cf239f4d9c
commit bc5bcfa66a

View File

@ -50,6 +50,7 @@ namespace osu.Game.Overlays
private readonly ChatTabControl channelTabs; private readonly ChatTabControl channelTabs;
private readonly Box chatBackground; private readonly Box chatBackground;
private readonly Box tabBackground;
private Bindable<double> chatHeight; private Bindable<double> chatHeight;
@ -120,11 +121,10 @@ namespace osu.Game.Overlays
Height = TAB_AREA_HEIGHT, Height = TAB_AREA_HEIGHT,
Children = new Drawable[] Children = new Drawable[]
{ {
new Box tabBackground = new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = Color4.Black, Colour = Color4.Black,
Alpha = 0.8f,
}, },
channelTabs = new ChatTabControl channelTabs = new ChatTabControl
{ {
@ -196,7 +196,11 @@ namespace osu.Game.Overlays
api.Register(this); api.Register(this);
chatHeight = config.GetBindable<double>(OsuConfig.ChatDisplayHeight); chatHeight = config.GetBindable<double>(OsuConfig.ChatDisplayHeight);
chatHeight.ValueChanged += h => Height = (float)h; chatHeight.ValueChanged += h =>
{
Height = (float)h;
tabBackground.FadeTo(Height == 1 ? 1 : 0.8f, 200);
};
chatHeight.TriggerChange(); chatHeight.TriggerChange();
chatBackground.Colour = colours.ChatBlue; chatBackground.Colour = colours.ChatBlue;