mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-30 09:47:58 +01:00
fixed OnMouseClick logic
This commit is contained in:
@@ -120,7 +120,7 @@ public partial class View
|
||||
|| mouseEvent.Flags.HasFlag (MouseFlags.Button3Clicked)
|
||||
|| mouseEvent.Flags.HasFlag (MouseFlags.Button4Clicked))
|
||||
{
|
||||
return OnMouseClick (args);
|
||||
OnMouseClick (args);
|
||||
}
|
||||
|
||||
if (mouseEvent.Flags.HasFlag (MouseFlags.Button1DoubleClicked)
|
||||
@@ -128,10 +128,13 @@ public partial class View
|
||||
|| mouseEvent.Flags.HasFlag (MouseFlags.Button3DoubleClicked)
|
||||
|| mouseEvent.Flags.HasFlag (MouseFlags.Button4DoubleClicked))
|
||||
{
|
||||
return OnMouseClick (args);
|
||||
OnMouseClick (args);
|
||||
}
|
||||
|
||||
MouseEvent?.Invoke (this, args);
|
||||
if (args.Handled != true)
|
||||
{
|
||||
MouseEvent?.Invoke (this, args);
|
||||
}
|
||||
|
||||
return args.Handled == true;
|
||||
}
|
||||
@@ -147,6 +150,7 @@ public partial class View
|
||||
{
|
||||
if (!Enabled)
|
||||
{
|
||||
args.Handled = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -158,6 +162,7 @@ public partial class View
|
||||
|
||||
if (!HasFocus && CanFocus)
|
||||
{
|
||||
args.Handled = true;
|
||||
SetFocus ();
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,16 @@ public class Button : View
|
||||
|
||||
private void Button_MouseEvent (object sender, MouseEventEventArgs e)
|
||||
{
|
||||
if (e.MouseEvent.Flags.HasFlag(MouseFlags.Button1Clicked))
|
||||
{
|
||||
if (Application.MouseGrabView != this)
|
||||
{
|
||||
e.Handled = InvokeCommand (Command.HotKey) == true;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (e.MouseEvent.Flags == MouseFlags.Button1Pressed)
|
||||
{
|
||||
if (Application.MouseGrabView == this)
|
||||
|
||||
@@ -74,6 +74,7 @@ public class AutoInitShutdownAttribute : BeforeAfterTestAttribute
|
||||
|
||||
if (AutoInit)
|
||||
{
|
||||
// TODO: This Dispose call is here until all unit tests that don't correctly dispose Toplevel's they create are fixed.
|
||||
Application.Top?.Dispose ();
|
||||
Application.Shutdown ();
|
||||
#if DEBUG_IDISPOSABLE
|
||||
|
||||
Reference in New Issue
Block a user