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
1 changed files with 6 additions and 3 deletions

View File

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