1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 08:12:56 +08:00

Add a testcase

This commit is contained in:
EVAST9919 2019-05-30 23:07:04 +03:00
parent 2933169614
commit fe9e53e383
4 changed files with 70 additions and 37 deletions

View File

@ -0,0 +1,31 @@
// 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.Game.Overlays.Profile.Sections;
using System;
using System.Collections.Generic;
using osu.Framework.Graphics;
namespace osu.Game.Tests.Visual.Online
{
public class TestSceneShowMoreButton : OsuTestScene
{
private readonly ShowMoreButton button;
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(ShowMoreButton),
};
public TestSceneShowMoreButton()
{
Add(button = new ShowMoreButton
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
});
AddStep("switch loading state", () => button.IsLoading = !button.IsLoading);
}
}
}

View File

@ -24,7 +24,8 @@ namespace osu.Game.Graphics.Containers
{ {
Enabled.ValueChanged += e => Enabled.ValueChanged += e =>
{ {
if (!e.NewValue) unhover(); if (!e.NewValue)
unhover();
}; };
} }
@ -49,7 +50,8 @@ namespace osu.Game.Graphics.Containers
private void unhover() private void unhover()
{ {
if (!isHovered) return; if (!isHovered)
return;
isHovered = false; isHovered = false;
EffectTargets.ForEach(d => d.FadeColour(IdleColour, FADE_DURATION, Easing.OutQuint)); EffectTargets.ForEach(d => d.FadeColour(IdleColour, FADE_DURATION, Easing.OutQuint));

View File

@ -54,6 +54,8 @@ namespace osu.Game.Overlays.Profile.Sections
}, },
MoreButton = new ShowMoreButton MoreButton = new ShowMoreButton
{ {
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Alpha = 0, Alpha = 0,
Margin = new MarginPadding { Top = 10 }, Margin = new MarginPadding { Top = 10 },
Action = ShowMore, Action = ShowMore,

View File

@ -51,8 +51,6 @@ namespace osu.Game.Overlays.Profile.Sections
public ShowMoreButton() public ShowMoreButton()
{ {
Anchor = Anchor.TopCentre;
Origin = Anchor.TopCentre;
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
Children = new Drawable[] Children = new Drawable[]
{ {