Merge branch 'master' into update-framework

This commit is contained in:
Bartłomiej Dach
2022-11-26 16:19:36 +01:00
40 changed files with 252 additions and 180 deletions

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics.Shapes;
using osu.Framework.Utils;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics.UserInterfaceV2;
using osuTK;
using osuTK.Graphics;
@ -49,8 +50,8 @@ namespace osu.Game.Tests.Visual.UserInterface
Children = new Drawable[]
{
new OsuSpriteText { Text = "Sample content" },
new TriangleButton { Text = "can't puush me", Width = 200, },
new TriangleButton { Text = "puush me", Width = 200, Action = () => { } },
new RoundedButton { Text = "can't puush me", Width = 200, },
new RoundedButton { Text = "puush me", Width = 200, Action = () => { } },
}
},
overlay = new TestLoadingLayer(true),

View File

@ -33,7 +33,7 @@ namespace osu.Game.Tests.Visual.UserInterface
Text = @"No OverlayColourProvider",
Font = OsuFont.Default.With(size: 40)
},
new TriangleButtonWithPopover()
new RoundedButtonWithPopover()
}
};
@ -50,15 +50,15 @@ namespace osu.Game.Tests.Visual.UserInterface
Text = @"With OverlayColourProvider (orange)",
Font = OsuFont.Default.With(size: 40)
},
new TriangleButtonWithPopover()
new RoundedButtonWithPopover()
}
}
};
}
private partial class TriangleButtonWithPopover : TriangleButton, IHasPopover
private partial class RoundedButtonWithPopover : RoundedButton, IHasPopover
{
public TriangleButtonWithPopover()
public RoundedButtonWithPopover()
{
Width = 100;
Height = 30;

View File

@ -9,7 +9,6 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Overlays;
using osu.Game.Overlays.Settings;
@ -37,7 +36,7 @@ namespace osu.Game.Tests.Visual.UserInterface
},
new SettingsButton
{
Text = "Test button",
Text = "Test settings button",
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Enabled = { BindTarget = enabled },
@ -56,8 +55,8 @@ namespace osu.Game.Tests.Visual.UserInterface
public void TestBackgroundColour()
{
AddStep("set red scheme", () => CreateThemedContent(OverlayColourScheme.Red));
AddAssert("rounded button has correct colour", () => Cell(0, 1).ChildrenOfType<RoundedButton>().First().BackgroundColour == new OsuColour().Blue3);
AddAssert("settings button has correct colour", () => Cell(0, 1).ChildrenOfType<SettingsButton>().First().BackgroundColour == new OverlayColourProvider(OverlayColourScheme.Red).Highlight1);
AddAssert("rounded button has correct colour", () => Cell(0, 1).ChildrenOfType<RoundedButton>().First().BackgroundColour == new OverlayColourProvider(OverlayColourScheme.Red).Colour3);
AddAssert("settings button has correct colour", () => Cell(0, 1).ChildrenOfType<SettingsButton>().First().BackgroundColour == new OverlayColourProvider(OverlayColourScheme.Red).Colour3);
}
}
}

View File

@ -11,6 +11,7 @@ using osu.Framework.Screens;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Screens;
using osuTK;
@ -109,7 +110,7 @@ namespace osu.Game.Tests.Visual.UserInterface
Origin = Anchor.TopCentre,
Text = Title,
},
new TriangleButton
new RoundedButton
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,