mirror of
https://github.com/osukey/osukey.git
synced 2025-04-29 10:47:22 +09:00
Move hover logic to SettingsToolboxGroup
to avoid expanded state clash
This commit is contained in:
parent
6a0bf89401
commit
a02556d2fa
@ -135,12 +135,14 @@ namespace osu.Game.Overlays
|
|||||||
protected override bool OnHover(HoverEvent e)
|
protected override bool OnHover(HoverEvent e)
|
||||||
{
|
{
|
||||||
updateFadeState();
|
updateFadeState();
|
||||||
|
updateExpandedState(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnHoverLost(HoverLostEvent e)
|
protected override void OnHoverLost(HoverLostEvent e)
|
||||||
{
|
{
|
||||||
updateFadeState();
|
updateFadeState();
|
||||||
|
updateExpandedState(true);
|
||||||
base.OnHoverLost(e);
|
base.OnHoverLost(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +170,7 @@ namespace osu.Game.Overlays
|
|||||||
// potentially continuing to get processed while content has changed to autosize.
|
// potentially continuing to get processed while content has changed to autosize.
|
||||||
content.ClearTransforms();
|
content.ClearTransforms();
|
||||||
|
|
||||||
if (Expanded.Value)
|
if (Expanded.Value || IsHovered)
|
||||||
{
|
{
|
||||||
content.AutoSizeAxes = Axes.Y;
|
content.AutoSizeAxes = Axes.Y;
|
||||||
content.AutoSizeDuration = animate ? transition_duration : 0;
|
content.AutoSizeDuration = animate ? transition_duration : 0;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
|
|
||||||
@ -15,28 +13,12 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool expandedByDefault = true;
|
|
||||||
|
|
||||||
protected override bool OnHover(HoverEvent e)
|
protected override bool OnHover(HoverEvent e)
|
||||||
{
|
{
|
||||||
if (IsHovered && !Expanded.Value)
|
|
||||||
{
|
|
||||||
Expanded.Value = true;
|
|
||||||
expandedByDefault = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
base.OnHover(e);
|
base.OnHover(e);
|
||||||
|
|
||||||
// Importantly, return true to correctly take focus away from PlayerLoader.
|
// Importantly, return true to correctly take focus away from PlayerLoader.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnHoverLost(HoverLostEvent e)
|
|
||||||
{
|
|
||||||
if (!expandedByDefault)
|
|
||||||
Expanded.Value = false;
|
|
||||||
|
|
||||||
base.OnHoverLost(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user