1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 04:42:58 +08:00

Always use OverlayColourProvider in scroll containers if available

This commit is contained in:
Bartłomiej Dach 2021-10-13 22:05:46 +02:00
parent d4e3460912
commit 7e7b747755
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -1,11 +1,14 @@
// 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.
#nullable enable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Game.Overlays;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
using osuTK.Input; using osuTK.Input;
@ -141,12 +144,12 @@ namespace osu.Game.Graphics.Containers
Child = box = new Box { RelativeSizeAxes = Axes.Both }; Child = box = new Box { RelativeSizeAxes = Axes.Both };
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader(true)]
private void load(OsuColour colours) private void load(OverlayColourProvider? colourProvider, OsuColour colours)
{ {
Colour = defaultColour = colours.Gray8; Colour = defaultColour = colours.Gray8;
hoverColour = colours.GrayF; hoverColour = colours.GrayF;
highlightColour = colours.Green; highlightColour = colourProvider?.Highlight1 ?? colours.Green;
} }
public override void ResizeTo(float val, int duration = 0, Easing easing = Easing.None) public override void ResizeTo(float val, int duration = 0, Easing easing = Easing.None)