Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion samples/Myra.Samples.AllWidgets/AllWidgets.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ private void BuildUI()
_buttonSaveFile.Id = "_buttonSaveFile";
Grid.SetColumn(_buttonSaveFile, 1);
_buttonSaveFile.Content = horizontalStackPanel1;
_buttonSaveFile.MouseCursor = MouseCursorType.Hand;

_textSaveFile = new TextBox();
_textSaveFile = new TextBox();
_textSaveFile.Id = "_textSaveFile";
Grid.SetColumn(_textSaveFile, 2);

Expand Down
25 changes: 19 additions & 6 deletions src/Myra/Graphics2D/UI/Widget.Input.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,25 @@ void IInputEventsProcessor.ProcessEvent(InputEventType eventType)

_lastMouseMovement = null;

if (MyraEnvironment.SetMouseCursorFromWidget && MouseCursor != null)
{
MyraEnvironment.MouseCursorType = MyraEnvironment.DefaultMouseCursorType;
}

OnMouseLeft();
if (MyraEnvironment.SetMouseCursorFromWidget && MouseCursor != null)
{
Widget ancestor = Parent;
while (ancestor != null && !ancestor.IsMouseInside)
{
ancestor = ancestor.Parent;
}

if (ancestor != null && ancestor.MouseCursor != null)
{
MyraEnvironment.MouseCursorType = ancestor.MouseCursor.Value;
}
else
{
MyraEnvironment.MouseCursorType = MyraEnvironment.DefaultMouseCursorType;
}
}

OnMouseLeft();
MouseLeft.Invoke(this);
break;
case InputEventType.MouseEntered:
Expand Down
Loading