mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 23:12:56 +08:00
Merge pull request #21921 from bdach/fix-toolbar-hover-through
Fix hover propagating through toolbar buttons
This commit is contained in:
commit
1bebfe56f2
@ -201,6 +201,22 @@ namespace osu.Game.Tests.Visual.Menus
|
||||
AddAssert("volume not changed", () => Audio.Volume.Value == 0.5);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestRulesetSelectorOverflow()
|
||||
{
|
||||
AddStep("set toolbar width", () =>
|
||||
{
|
||||
toolbar.RelativeSizeAxes = Axes.None;
|
||||
toolbar.Width = 0;
|
||||
});
|
||||
AddStep("move mouse over news toggle button", () =>
|
||||
{
|
||||
var button = toolbar.ChildrenOfType<ToolbarNewsButton>().Single();
|
||||
InputManager.MoveMouseTo(button);
|
||||
});
|
||||
AddAssert("no ruleset toggle buttons hovered", () => !toolbar.ChildrenOfType<ToolbarRulesetTabButton>().Any(button => button.IsHovered));
|
||||
}
|
||||
|
||||
public partial class TestToolbar : Toolbar
|
||||
{
|
||||
public new Bindable<OverlayActivation> OverlayActivationMode => base.OverlayActivationMode as Bindable<OverlayActivation>;
|
||||
|
@ -179,7 +179,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
HoverBackground.FadeIn(200);
|
||||
tooltipContainer.FadeIn(100);
|
||||
|
||||
return base.OnHover(e);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(HoverLostEvent e)
|
||||
|
Loading…
Reference in New Issue
Block a user