mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:43:05 +08:00
Allow customising the "close" button icon
This commit is contained in:
parent
1484ae19f0
commit
0f203531d9
@ -56,6 +56,8 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
public virtual bool Read { get; set; }
|
public virtual bool Read { get; set; }
|
||||||
|
|
||||||
|
protected virtual IconUsage CloseButtonIcon => FontAwesome.Solid.Check;
|
||||||
|
|
||||||
protected Notification()
|
protected Notification()
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
@ -116,7 +118,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new CloseButton
|
new CloseButton(CloseButtonIcon)
|
||||||
{
|
{
|
||||||
Action = Close,
|
Action = Close,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
@ -177,9 +179,16 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
private SpriteIcon icon = null!;
|
private SpriteIcon icon = null!;
|
||||||
private Box background = null!;
|
private Box background = null!;
|
||||||
|
|
||||||
|
private readonly IconUsage iconUsage;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OverlayColourProvider colourProvider { get; set; } = null!;
|
private OverlayColourProvider colourProvider { get; set; } = null!;
|
||||||
|
|
||||||
|
public CloseButton(IconUsage iconUsage)
|
||||||
|
{
|
||||||
|
this.iconUsage = iconUsage;
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
@ -198,7 +207,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Icon = FontAwesome.Solid.Check,
|
Icon = iconUsage,
|
||||||
Size = new Vector2(12),
|
Size = new Vector2(12),
|
||||||
Colour = colourProvider.Foreground1,
|
Colour = colourProvider.Foreground1,
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,10 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateProgress(float progress) => progressBar.Progress = progress;
|
protected override IconUsage CloseButtonIcon => FontAwesome.Solid.Times;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OverlayColourProvider colourProvider { get; set; } = null!;
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user