These features are really useful. Dark mode is great for radiology, I have employed your code into my Lazarus based MRI viewer
https://github.com/neurolabusc/MRIcroGL/issues/20I think this does a nice job of encapsulating useful MacOS features without interfering with the core LCL features and 'write once, compile everywhere' nature.
I do have two suggestions. I understand you are busy implementing core LCL Cocoa features, so these are low priority (want, not need). However, MacOS does provide two handy features that seem like a natural fit for your component:
1.) NSAlert is like a modal message, but it is attached to one specific form. This is great when you are using multiple applications, as it is obvious which form is the parent. A handy feature for your component would be to present a string of text for the user.
2.) NSUserNotification can be used for a lot of features. However, the easiest to implement for Lazrus, and a hugely influential role is to report a brief message that does not require any user intervention. This will tell the user something is happening, without requiring a modal response. For Lazarus, providing a string text message and a delay would be great.
Below are two XCode snippets to demonstrate these. These are both from my open source project
https://github.com/neurolabusc/MRIcroThis is available in compiled form with MRIcroGL
https://github.com/neurolabusc/MRIcroGL/releasesThe NSAlert is shown when you File/Open an image and then press the 'i' button, the Notification is shown when a user has the "Only initial volumes" preference checked and they load a huge 4D dataset: in this case only the first 1 Gb of images are loaded, and the notification tells the user that they are only seeing part of the dataset (and how to remedy this).
- (IBAction)notifyNotAllVolumesLoaded: (int) loadedVols RawVols: (int) rawVols;
{
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = [NSString stringWithFormat:@"Loaded %d of %d volumes", loadedVols, rawVols];
notification.informativeText = @"Reason: The preference 'Only initial volumes' is selected";
notification.soundName = NULL;
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
[NSTimer scheduledTimerWithTimeInterval: 4.5 target:self selector: @selector(closePopup) userInfo:self repeats:NO];
}
- (IBAction)infoClick:(id)sender { //
NSString *message = [niiGL getHeaderInfo];
NSBeginAlertSheet(@"Header Information", @"OK",NULL,NULL,theWindow, self,
NULL, NULL, NULL,
@"%@"
, message
);
}