mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 16:49:07 +02:00
Cocoa: fix the issue that ShowBalloonHint does not conform to conventions on macOS, issue #41016
This commit is contained in:
parent
2b70328d5d
commit
5db9facb32
@ -139,8 +139,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
class function TCocoaWSCustomTrayIcon.ShowBalloonHint(const ATrayIcon: TCustomTrayIcon): Boolean;
|
class function TCocoaWSCustomTrayIcon.ShowBalloonHint(const ATrayIcon: TCustomTrayIcon): Boolean;
|
||||||
|
var
|
||||||
|
nc: NSUserNotificationCenter;
|
||||||
|
message: NSUserNotification;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := True;
|
||||||
|
message:= NSUserNotification.alloc.init;
|
||||||
|
message.setTitle( StrToNSString(ATrayIcon.BalloonTitle) );
|
||||||
|
message.setInformativeText( StrToNSString(ATrayIcon.BalloonHint) );
|
||||||
|
nc:= NSUserNotificationCenter.defaultUserNotificationCenter;
|
||||||
|
nc.deliverNotification( message );
|
||||||
|
message.release;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TCocoaWSCustomTrayIcon.GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint;
|
class function TCocoaWSCustomTrayIcon.GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint;
|
||||||
|
@ -31,7 +31,7 @@ uses
|
|||||||
WSExtCtrls, WSLCLClasses,
|
WSExtCtrls, WSLCLClasses,
|
||||||
// LCL Cocoa
|
// LCL Cocoa
|
||||||
CocoaPrivate, CocoaMenus, CocoaWSCommon, CocoaGDIObjects, CocoaScrollers,
|
CocoaPrivate, CocoaMenus, CocoaWSCommon, CocoaGDIObjects, CocoaScrollers,
|
||||||
Cocoa_Extra;
|
Cocoa_Extra, CocoaUtils;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user