File tree Expand file tree Collapse file tree 2 files changed +21
-7
lines changed
samples/Myra.Samples.AllWidgets Expand file tree Collapse file tree 2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -129,8 +129,9 @@ private void BuildUI()
129129 _buttonSaveFile . Id = "_buttonSaveFile" ;
130130 Grid . SetColumn ( _buttonSaveFile , 1 ) ;
131131 _buttonSaveFile . Content = horizontalStackPanel1 ;
132+ _buttonSaveFile . MouseCursor = MouseCursorType . Hand ;
132133
133- _textSaveFile = new TextBox ( ) ;
134+ _textSaveFile = new TextBox ( ) ;
134135 _textSaveFile . Id = "_textSaveFile" ;
135136 Grid . SetColumn ( _textSaveFile , 2 ) ;
136137
Original file line number Diff line number Diff line change @@ -288,12 +288,25 @@ void IInputEventsProcessor.ProcessEvent(InputEventType eventType)
288288
289289 _lastMouseMovement = null ;
290290
291- if ( MyraEnvironment . SetMouseCursorFromWidget && MouseCursor != null )
292- {
293- MyraEnvironment . MouseCursorType = MyraEnvironment . DefaultMouseCursorType ;
294- }
295-
296- OnMouseLeft ( ) ;
291+ if ( MyraEnvironment . SetMouseCursorFromWidget && MouseCursor != null )
292+ {
293+ Widget ancestor = Parent ;
294+ while ( ancestor != null && ! ancestor . IsMouseInside )
295+ {
296+ ancestor = ancestor . Parent ;
297+ }
298+
299+ if ( ancestor != null && ancestor . MouseCursor != null )
300+ {
301+ MyraEnvironment . MouseCursorType = ancestor . MouseCursor . Value ;
302+ }
303+ else
304+ {
305+ MyraEnvironment . MouseCursorType = MyraEnvironment . DefaultMouseCursorType ;
306+ }
307+ }
308+
309+ OnMouseLeft ( ) ;
297310 MouseLeft . Invoke ( this ) ;
298311 break ;
299312 case InputEventType . MouseEntered :
You can’t perform that action at this time.
0 commit comments