1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-26 01:32:57 +08:00

Merge remote-tracking branch 'upstream/master' into add-chat-truncation

This commit is contained in:
Dean Herbert 2019-09-09 12:09:14 +09:00
commit d0e8b1efce
3 changed files with 37 additions and 8 deletions

View File

@ -1,5 +1,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputPath>bin\$(Configuration)</OutputPath> <OutputPath>bin\$(Configuration)</OutputPath>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>

View File

@ -62,21 +62,31 @@ namespace osu.Game.Graphics.Containers
protected override bool OnClick(ClickEvent e) protected override bool OnClick(ClickEvent e)
{ {
closeIfOutside(e); if (!base.ReceivePositionalInputAt(e.ScreenSpaceMousePosition))
Hide();
return base.OnClick(e); return base.OnClick(e);
} }
protected override bool OnDragEnd(DragEndEvent e) private bool closeOnDragEnd;
{
closeIfOutside(e);
return base.OnDragEnd(e);
}
private void closeIfOutside(MouseEvent e) protected override bool OnDragStart(DragStartEvent e)
{ {
if (!base.ReceivePositionalInputAt(e.ScreenSpaceMousePosition)) if (!base.ReceivePositionalInputAt(e.ScreenSpaceMousePosition))
closeOnDragEnd = true;
return base.OnDragStart(e);
}
protected override bool OnDragEnd(DragEndEvent e)
{
if (closeOnDragEnd)
{
Hide(); Hide();
closeOnDragEnd = false;
}
return base.OnDragEnd(e);
} }
public virtual bool OnPressed(GlobalAction action) public virtual bool OnPressed(GlobalAction action)

View File

@ -313,5 +313,22 @@ namespace osu.Game.Screens.Play
return base.OnMouseMove(e); return base.OnMouseMove(e);
} }
} }
[Resolved]
private GlobalActionContainer globalAction { get; set; }
protected override bool Handle(UIEvent e)
{
switch (e)
{
case ScrollEvent _:
if (ReceivePositionalInputAt(e.ScreenSpaceMousePosition))
return globalAction.TriggerEvent(e);
break;
}
return base.Handle(e);
}
} }
} }