mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-07 17:20:55 +02:00
Cocoa: simplify TCursorHelper by b184a37
This commit is contained in:
parent
00f1f50769
commit
c15816f136
@ -22,8 +22,6 @@ type
|
|||||||
TCursorHelper = class
|
TCursorHelper = class
|
||||||
private
|
private
|
||||||
_lastCursor: NSCursor;
|
_lastCursor: NSCursor;
|
||||||
private
|
|
||||||
procedure DoSetCursorOnActive( data:IntPtr );
|
|
||||||
public
|
public
|
||||||
procedure SetNewCursor( newCursor:TCocoaCursor );
|
procedure SetNewCursor( newCursor:TCocoaCursor );
|
||||||
public
|
public
|
||||||
@ -370,14 +368,6 @@ end;
|
|||||||
|
|
||||||
{ TCursorHelper }
|
{ TCursorHelper }
|
||||||
|
|
||||||
procedure TCursorHelper.DoSetCursorOnActive( data:IntPtr );
|
|
||||||
begin
|
|
||||||
if Screen.Cursor<>crDefault then
|
|
||||||
SetScreenCursor
|
|
||||||
else
|
|
||||||
SetCursorAtMousePos;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCursorHelper.SetNewCursor( newCursor:TCocoaCursor );
|
procedure TCursorHelper.SetNewCursor( newCursor:TCocoaCursor );
|
||||||
var
|
var
|
||||||
currentCursor: NSCursor;
|
currentCursor: NSCursor;
|
||||||
@ -393,7 +383,10 @@ end;
|
|||||||
class procedure TCursorHelper.SetCursorOnActive;
|
class procedure TCursorHelper.SetCursorOnActive;
|
||||||
begin
|
begin
|
||||||
CursorHelper._lastCursor:= nil;
|
CursorHelper._lastCursor:= nil;
|
||||||
Application.QueueAsyncCall( @CursorHelper.DoSetCursorOnActive, 0 );
|
if Screen.Cursor<>crDefault then
|
||||||
|
SetScreenCursor
|
||||||
|
else
|
||||||
|
SetCursorAtMousePos;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TCursorHelper.SetCursorAtMousePos;
|
class procedure TCursorHelper.SetCursorAtMousePos;
|
||||||
|
Loading…
Reference in New Issue
Block a user