mirror of https://github.com/ppy/osu
Fix textbox colours not always being set corrrectly
This commit is contained in:
parent
144533706e
commit
82d944dc89
|
@ -1,7 +1,6 @@
|
||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
@ -53,10 +52,9 @@ public FilterControl()
|
||||||
|
|
||||||
public class FilterTextBox : SearchTextBox
|
public class FilterTextBox : SearchTextBox
|
||||||
{
|
{
|
||||||
private Color4 backgroundColour;
|
protected override Color4 BackgroundUnfocused => OsuColour.Gray(0.06f);
|
||||||
|
protected override Color4 BackgroundFocused => OsuColour.Gray(0.12f);
|
||||||
|
|
||||||
protected override Color4 BackgroundUnfocused => backgroundColour;
|
|
||||||
protected override Color4 BackgroundFocused => backgroundColour;
|
|
||||||
protected override bool AllowCommit => true;
|
protected override bool AllowCommit => true;
|
||||||
|
|
||||||
public FilterTextBox()
|
public FilterTextBox()
|
||||||
|
@ -64,12 +62,6 @@ public FilterTextBox()
|
||||||
Masking = true;
|
Masking = true;
|
||||||
CornerRadius = 5;
|
CornerRadius = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuColour colours)
|
|
||||||
{
|
|
||||||
backgroundColour = colours.Gray2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,17 +127,10 @@ protected override void Update()
|
||||||
|
|
||||||
private class FilterSearchTextBox : SearchTextBox
|
private class FilterSearchTextBox : SearchTextBox
|
||||||
{
|
{
|
||||||
protected override Color4 BackgroundUnfocused => backgroundColour;
|
protected override Color4 BackgroundUnfocused => OsuColour.Gray(0.06f);
|
||||||
protected override Color4 BackgroundFocused => backgroundColour;
|
protected override Color4 BackgroundFocused => OsuColour.Gray(0.12f);
|
||||||
|
|
||||||
protected override bool AllowCommit => true;
|
protected override bool AllowCommit => true;
|
||||||
|
|
||||||
private Color4 backgroundColour;
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuColour colours)
|
|
||||||
{
|
|
||||||
backgroundColour = colours.Gray2.Opacity(0.9f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue