mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 23:50:25 +02:00
Cocoa/Config: turn Notification Config to the new Style
This commit is contained in:
parent
3e0fbda2b8
commit
f90c864215
@ -91,3 +91,11 @@ var
|
|||||||
);
|
);
|
||||||
);
|
);
|
||||||
|
|
||||||
|
var
|
||||||
|
CocoaConfigNotification: TCocoaConfigNotification = (
|
||||||
|
// by default on macOS, Notification is only Presented when the APP is
|
||||||
|
// in the background.
|
||||||
|
// when CocoaAlwaysPresentNotification is set to True, Notification is
|
||||||
|
// always Presented.
|
||||||
|
alwaysPresent: True;
|
||||||
|
);
|
||||||
|
@ -139,7 +139,11 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
TCocoaConfigNotification = record
|
||||||
|
alwaysPresent: Boolean;
|
||||||
|
end;
|
||||||
|
|
||||||
|
type
|
||||||
// on macOS, the FocusRing takes up extra space, which may cause strange
|
// on macOS, the FocusRing takes up extra space, which may cause strange
|
||||||
// display in some cases. it may block other controls, or be partially cut off.
|
// display in some cases. it may block other controls, or be partially cut off.
|
||||||
// for example, in the Lazarus IDE - About dialog, the FocusRing of the
|
// for example, in the Lazarus IDE - About dialog, the FocusRing of the
|
||||||
@ -164,13 +168,6 @@ type
|
|||||||
function getCocoaControlFocusRingStrategry( AClassName: NSString ): TCocoaFocusRingStrategy;
|
function getCocoaControlFocusRingStrategry( AClassName: NSString ): TCocoaFocusRingStrategy;
|
||||||
|
|
||||||
var
|
var
|
||||||
// by default on macOS, Notification is only Presented when the APP is
|
|
||||||
// in the background.
|
|
||||||
// when CocoaAlwaysPresentNotification is set to True, Notification is
|
|
||||||
// always Presented.
|
|
||||||
CocoaAlwaysPresentNotification : Boolean = True;
|
|
||||||
|
|
||||||
|
|
||||||
// for compatiblity with LCL 1.8 release. The macOS base is 72ppi
|
// for compatiblity with LCL 1.8 release. The macOS base is 72ppi
|
||||||
CocoaBasePPI : Integer = 96;
|
CocoaBasePPI : Integer = 96;
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ begin
|
|||||||
message.setSoundName( NSUserNotificationDefaultSoundName );
|
message.setSoundName( NSUserNotificationDefaultSoundName );
|
||||||
|
|
||||||
nc:= NSUserNotificationCenter.defaultUserNotificationCenter;
|
nc:= NSUserNotificationCenter.defaultUserNotificationCenter;
|
||||||
if CocoaConfig.CocoaAlwaysPresentNotification then begin
|
if CocoaConfigNotification.alwaysPresent then begin
|
||||||
if NOT Assigned(nc.delegate) then
|
if NOT Assigned(nc.delegate) then
|
||||||
nc.setDelegate( TCocoaUserNotificationCenterDelegate.new );
|
nc.setDelegate( TCocoaUserNotificationCenterDelegate.new );
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user