2023-06-23 00:37:25 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2022-05-04 16:41:29 +08:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Input.Events;
|
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Edit
|
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
|
public partial class ExpandingToolboxContainer : ExpandingContainer
|
2022-05-04 16:41:29 +08:00
|
|
|
|
{
|
|
|
|
|
protected override double HoverExpansionDelay => 250;
|
|
|
|
|
|
|
|
|
|
public ExpandingToolboxContainer(float contractedWidth, float expandedWidth)
|
|
|
|
|
: base(contractedWidth, expandedWidth)
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Y;
|
|
|
|
|
|
2022-10-18 13:38:45 +08:00
|
|
|
|
FillFlow.Spacing = new Vector2(5);
|
|
|
|
|
Padding = new MarginPadding { Vertical = 5 };
|
2022-05-04 16:41:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool ReceivePositionalInputAtSubTree(Vector2 screenSpacePos) => base.ReceivePositionalInputAtSubTree(screenSpacePos) && anyToolboxHovered(screenSpacePos);
|
|
|
|
|
|
|
|
|
|
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => base.ReceivePositionalInputAt(screenSpacePos) && anyToolboxHovered(screenSpacePos);
|
|
|
|
|
|
2022-05-06 18:06:40 +08:00
|
|
|
|
private bool anyToolboxHovered(Vector2 screenSpacePos) => FillFlow.ScreenSpaceDrawQuad.Contains(screenSpacePos);
|
2022-05-04 16:41:29 +08:00
|
|
|
|
|
|
|
|
|
protected override bool OnMouseDown(MouseDownEvent e) => true;
|
|
|
|
|
|
|
|
|
|
protected override bool OnClick(ClickEvent e) => true;
|
|
|
|
|
}
|
|
|
|
|
}
|