Comments (6)
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)
from delphidarkmode.
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
from delphidarkmode.
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
from delphidarkmode.
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.
from delphidarkmode.
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. π€ͺ
from delphidarkmode.
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.
from delphidarkmode.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delphidarkmode.