Bubble unhandled double-click events to OnClick.
This commit is contained in:
@@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
// Equivalent to OnMouseUp, but without an input arg
|
// Equivalent to OnMouseUp, but without an input arg
|
||||||
public Action OnClick = () => { };
|
public Action OnClick = () => { };
|
||||||
public Action OnDoubleClick = () => { };
|
public Action OnDoubleClick = null;
|
||||||
public Action<KeyInput> OnKeyPress = _ => { };
|
public Action<KeyInput> OnKeyPress = _ => { };
|
||||||
|
|
||||||
public string Cursor = ChromeMetrics.Get<string>("ButtonCursor");
|
public string Cursor = ChromeMetrics.Get<string>("ButtonCursor");
|
||||||
@@ -163,7 +163,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
var disabled = IsDisabled();
|
var disabled = IsDisabled();
|
||||||
if (HasMouseFocus && mi.Event == MouseInputEvent.Up && mi.MultiTapCount == 2)
|
if (HasMouseFocus && mi.Event == MouseInputEvent.Up && mi.MultiTapCount == 2 && OnDoubleClick != null)
|
||||||
{
|
{
|
||||||
if (!disabled)
|
if (!disabled)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user