Recolour focused text box variant

This commit is contained in:
Bartłomiej Dach 2021-10-17 12:58:37 +02:00
parent addcef4f5d
commit 1ec881ce1d
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
1 changed files with 8 additions and 5 deletions

View File

@ -1,6 +1,8 @@
// 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.
#nullable enable
using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Input.Events;
@ -8,6 +10,7 @@
using osu.Game.Input.Bindings;
using osuTK.Input;
using osu.Framework.Input.Bindings;
using osu.Game.Overlays;
namespace osu.Game.Graphics.UserInterface
{
@ -42,13 +45,13 @@ public bool HoldFocus
}
[Resolved]
private GameHost host { get; set; }
private GameHost? host { get; set; }
[BackgroundDependencyLoader]
private void load()
[BackgroundDependencyLoader(true)]
private void load(OverlayColourProvider? colourProvider)
{
BackgroundUnfocused = new Color4(10, 10, 10, 255);
BackgroundFocused = new Color4(10, 10, 10, 255);
BackgroundUnfocused = colourProvider?.Background5 ?? new Color4(10, 10, 10, 255);
BackgroundFocused = colourProvider?.Background5 ?? new Color4(10, 10, 10, 255);
}
// We may not be focused yet, but we need to handle keyboard input to be able to request focus