Skip to content

Commit

Permalink
Move click-to-expand logic to a higher level
Browse files Browse the repository at this point in the history
Think it makes more sense there.
  • Loading branch information
bdach committed Dec 26, 2024
1 parent df3e581 commit d37b4bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 10 additions & 0 deletions osu.Game/Graphics/Containers/ExpandingContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ protected override bool OnHover(HoverEvent e)
return true;
}

protected override bool OnClick(ClickEvent e)
{
base.OnClick(e);

if (!Expanded.Value)
Expanded.Value = true;

return true;
}

protected override bool OnMouseMove(MouseMoveEvent e)
{
updateHoverExpansion();
Expand Down
10 changes: 0 additions & 10 deletions osu.Game/Rulesets/Edit/ExpandingToolboxContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,5 @@ protected override void Update()
private bool anyToolboxHovered(Vector2 screenSpacePos) => FillFlow.ScreenSpaceDrawQuad.Contains(screenSpacePos);

protected override bool OnMouseDown(MouseDownEvent e) => true;

protected override bool OnClick(ClickEvent e)
{
base.OnClick(e);

if (!Expanded.Value)
Expanded.Value = true;

return true;
}
}
}

0 comments on commit d37b4bc

Please sign in to comment.