From 1ec881ce1d9306c4d3b326b1d44e81a64206a490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Sun, 17 Oct 2021 12:58:37 +0200 Subject: [PATCH] Recolour focused text box variant --- osu.Game/Graphics/UserInterface/FocusedTextBox.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs index ceea9620c8..88608bf43c 100644 --- a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs +++ b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs @@ -1,6 +1,8 @@ // Copyright (c) ppy Pty Ltd . 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