-
Notifications
You must be signed in to change notification settings - Fork 11
Add FMX version #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Eventually one could contribute an implementation of IFMXSystemApperanceService for Windows, as mentioned at https://quality.embarcadero.com/browse/RSP-37290 and in comments at https://stackoverflow.com/a/67457500/903783 |
Hmm. There is an intention to refactor this as a class helper for forms. This is how I've seen things like rounded corners done and so on and I've seen Marco Cantu using this method as well. With it refactored as a class helper it would be a little more than conditional defines but still doable. 👍 I think I'll definitely add FMX support and likely combine in the rounded corners control too just for good measure. |
what I was meaning is that FMX has a service to get dark mode info (but not notification for it switching I think) for OS-X, iOS, Android but not for Windows. Such platform services are defined as interfaces and then concrete implementations per platform are provided. The client just asks FMX for an FMX service interface implementation for the current platform and it checks if one has been registered for the current platform/architecture and returns it. So the missing Windows bits could be taken from your implementation and have a full FMX implementation for all platforms (ok, apart from Linux), with the missing part though being registering for notifications (the FMX service definition lacks that I think as a concept) |
Yes, but the FMX service as it stands would limit the minimum version of Delphi/C++ builder it would work with. That said it's not a bad idea to add in the missing Windows capabilities. The trapping of the change event is relatively simple on Windows (until Microsoft change how it works!) but for other platforms it's not quite as universally supported which may be why it was avoided in the first place. Thanks for the inspiration. I just need to invent a few extra weekdays now, so I get the time to do it all. 🤪 |
actually, I'd expect Embarcadero to port those interfaces back into VCL so that one could evolve their VCL app gradually with such features and eventually either port it or maintain both VCL and FMX versions of their app with a large common codebase |
I would be very surprised if there is not something along these lines planned. Marco Cantú did a similar thing with a class helper for TForm in a recent blog post of his - that would be my suggested method since it's a more clean implementation. |
Could use some conditional defines I think to check if the project is FMX or VCL one and use the appropriate Style management unit. The more or less the rest of the code should be the same
The text was updated successfully, but these errors were encountered: