1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:47:28 +08:00

Merge pull request #21921 from bdach/fix-toolbar-hover-through

Fix hover propagating through toolbar buttons
This commit is contained in:
Dean Herbert 2022-12-29 21:03:42 +08:00 committed by GitHub
commit 1bebfe56f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -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>;

View File

@ -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)