Initial design update pass

This commit is contained in:
Dean Herbert
2022-08-30 17:33:08 +09:00
parent 0e68620f70
commit 1484ae19f0
4 changed files with 100 additions and 88 deletions

View File

@ -3,7 +3,6 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
@ -24,7 +23,8 @@ namespace osu.Game.Overlays.Notifications
set
{
text = value;
textDrawable.Text = text;
if (textDrawable != null)
textDrawable.Text = text;
}
}
@ -36,48 +36,46 @@ namespace osu.Game.Overlays.Notifications
set
{
icon = value;
iconDrawable.Icon = icon;
if (iconDrawable != null)
iconDrawable.Icon = icon;
}
}
private readonly TextFlowContainer textDrawable;
private readonly SpriteIcon iconDrawable;
protected Box IconBackground = null!;
protected Box IconBackground;
private TextFlowContainer? textDrawable;
public SimpleNotification()
private SpriteIcon? iconDrawable;
[BackgroundDependencyLoader]
private void load(OsuColour colours, OverlayColourProvider colourProvider)
{
Light.Colour = colours.Green;
IconContent.AddRange(new Drawable[]
{
IconBackground = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = ColourInfo.GradientVertical(OsuColour.Gray(0.2f), OsuColour.Gray(0.6f))
Colour = colourProvider.Background5,
},
iconDrawable = new SpriteIcon
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Icon = icon,
Size = new Vector2(20),
Size = new Vector2(16),
}
});
Content.Add(textDrawable = new OsuTextFlowContainer(t => t.Font = t.Font.With(size: 14))
Content.Add(textDrawable = new OsuTextFlowContainer(t => t.Font = t.Font.With(size: 14, weight: FontWeight.Medium))
{
Colour = OsuColour.Gray(128),
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Text = text
});
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Light.Colour = colours.Green;
}
public override bool Read
{
get => base.Read;