mirror of
https://github.com/osukey/osukey.git
synced 2025-05-08 07:07:18 +09:00
Merge branch 'master' into beatmap-refactor/remove-online-info
This commit is contained in:
commit
acb06d4a99
@ -1,6 +1,7 @@
|
|||||||
// 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.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -65,10 +66,10 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
private void createPaddedComponent(bool hasDescription = false, bool padded = true)
|
private void createPaddedComponent(bool hasDescription = false, bool padded = true)
|
||||||
{
|
{
|
||||||
|
LabelledDrawable<Drawable> component = null;
|
||||||
|
|
||||||
AddStep("create component", () =>
|
AddStep("create component", () =>
|
||||||
{
|
{
|
||||||
LabelledDrawable<Drawable> component;
|
|
||||||
|
|
||||||
Child = new Container
|
Child = new Container
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
@ -81,6 +82,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
component.Label = "a sample component";
|
component.Label = "a sample component";
|
||||||
component.Description = hasDescription ? "this text describes the component" : string.Empty;
|
component.Description = hasDescription ? "this text describes the component" : string.Empty;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
AddAssert($"description {(hasDescription ? "visible" : "hidden")}", () => component.ChildrenOfType<TextFlowContainer>().ElementAt(1).IsPresent == hasDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class PaddedLabelledDrawable : LabelledDrawable<Drawable>
|
private class PaddedLabelledDrawable : LabelledDrawable<Drawable>
|
||||||
|
@ -168,7 +168,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
|||||||
{
|
{
|
||||||
descriptionText.Text = value;
|
descriptionText.Text = value;
|
||||||
|
|
||||||
if (value == default)
|
if (!string.IsNullOrEmpty(value.ToString()))
|
||||||
descriptionText.Show();
|
descriptionText.Show();
|
||||||
else
|
else
|
||||||
descriptionText.Hide();
|
descriptionText.Hide();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user