1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 22:19:30 +08:00

Shrink and darken loading layer to better suit button

This commit is contained in:
Dean Herbert 2019-11-12 21:38:16 +09:00
parent 5110ae82a1
commit da819261e0
2 changed files with 6 additions and 5 deletions

View File

@ -6,6 +6,7 @@ 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.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osuTK;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
@ -15,7 +16,7 @@ namespace osu.Game.Graphics.UserInterface
private readonly LoadingAnimation loading; private readonly LoadingAnimation loading;
public DimmedLoadingLayer() public DimmedLoadingLayer(float dimAmount = 0.5f, float iconScale = 1f)
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
Children = new Drawable[] Children = new Drawable[]
@ -23,9 +24,9 @@ namespace osu.Game.Graphics.UserInterface
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = Color4.Black.Opacity(0.5f), Colour = Color4.Black.Opacity(dimAmount),
}, },
loading = new LoadingAnimation(), loading = new LoadingAnimation { Scale = new Vector2(iconScale) },
}; };
} }

View File

@ -1,4 +1,4 @@
// 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.
using System.Diagnostics; using System.Diagnostics;
@ -42,7 +42,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
Size = new Vector2(18), Size = new Vector2(18),
Shadow = false, Shadow = false,
}, },
loading = new DimmedLoadingLayer(), loading = new DimmedLoadingLayer(0.8f, 0.5f),
}); });
favourited.ValueChanged += favourited => icon.Icon = favourited.NewValue ? FontAwesome.Solid.Heart : FontAwesome.Regular.Heart; favourited.ValueChanged += favourited => icon.Icon = favourited.NewValue ? FontAwesome.Solid.Heart : FontAwesome.Regular.Heart;