1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-12 00:42:55 +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.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Input;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Layout; using osu.Framework.Layout;
using osu.Game.Graphics; using osu.Game.Graphics;
@ -54,6 +55,8 @@ namespace osu.Game.Overlays
private IconButton expandButton = null!; private IconButton expandButton = null!;
private InputManager inputManager = null!;
/// <summary> /// <summary>
/// Create a new instance. /// Create a new instance.
/// </summary> /// </summary>
@ -125,6 +128,8 @@ namespace osu.Game.Overlays
{ {
base.LoadComplete(); base.LoadComplete();
inputManager = GetContainingInputManager()!;
Expanded.BindValueChanged(_ => updateExpandedState(true)); Expanded.BindValueChanged(_ => updateExpandedState(true));
updateExpandedState(false); updateExpandedState(false);
@ -172,7 +177,9 @@ 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 || IsHovered) bool sliderDraggedInHimself = inputManager.DraggedDrawable.IsRootedAt(this);
if (Expanded.Value || IsHovered || sliderDraggedInHimself)
{ {
content.AutoSizeAxes = Axes.Y; content.AutoSizeAxes = Axes.Y;
content.AutoSizeDuration = animate ? transition_duration : 0; content.AutoSizeDuration = animate ? transition_duration : 0;