Fix settings notice text class tinting everything with yellow

This commit is contained in:
Salman Ahmed 2021-08-14 20:14:21 +03:00
parent f43ab323ff
commit c8fb796660
3 changed files with 4 additions and 6 deletions

View File

@ -91,7 +91,7 @@ private void load(OsuColour colours)
Origin = Anchor.TopCentre,
Text = TabletSettingsStrings.NoTabletDetected,
},
new SettingsNoticeText
new SettingsNoticeText(colours)
{
TextAnchor = Anchor.TopCentre,
Anchor = Anchor.TopCentre,

View File

@ -73,7 +73,7 @@ public LocalisableString? WarningText
return;
// construct lazily for cases where the label is not needed (may be provided by the Control).
FlowContent.Add(warningText = new SettingsNoticeText { Margin = new MarginPadding { Bottom = 5 } });
FlowContent.Add(warningText = new SettingsNoticeText(colours) { Margin = new MarginPadding { Bottom = 5 } });
}
warningText.Alpha = hasValue ? 0 : 1;

View File

@ -1,7 +1,6 @@
// 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.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
@ -10,10 +9,9 @@ namespace osu.Game.Overlays.Settings
{
public class SettingsNoticeText : LinkFlowContainer
{
[BackgroundDependencyLoader]
private void load(OsuColour colours)
public SettingsNoticeText(OsuColour colours)
: base(s => s.Colour = colours.Yellow)
{
Colour = colours.Yellow;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
}