1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-06 20:22:56 +08:00

Fix toolbox settings hiding when dragging a slider

This commit is contained in:
Rudi Herouard 2025-01-20 16:35:21 +01:00
parent c20b836d9c
commit b9da0e8516

View File

@ -8,6 +8,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input;
using osu.Framework.Input.Events;
using osu.Framework.Layout;
using osu.Game.Graphics;
@ -54,6 +55,8 @@ namespace osu.Game.Overlays
private IconButton expandButton = null!;
private InputManager inputManager = null!;
/// <summary>
/// Create a new instance.
/// </summary>
@ -125,6 +128,8 @@ namespace osu.Game.Overlays
{
base.LoadComplete();
inputManager = GetContainingInputManager()!;
Expanded.BindValueChanged(_ => updateExpandedState(true));
updateExpandedState(false);
@ -172,7 +177,9 @@ namespace osu.Game.Overlays
// potentially continuing to get processed while content has changed to autosize.
content.ClearTransforms();
if (Expanded.Value || IsHovered)
bool sliderDraggedInHimself = inputManager.DraggedDrawable.IsRootedAt(this);
if (Expanded.Value || IsHovered || sliderDraggedInHimself)
{
content.AutoSizeAxes = Axes.Y;
content.AutoSizeDuration = animate ? transition_duration : 0;