Markus Winter Member Licensed User May 24, 2021 #1 Ok, I searched for 5 min but haven't found an answer, so time for a new thread: How do I support light and dark mode on the DESKTOP? TiA Markus
Ok, I searched for 5 min but haven't found an answer, so time for a new thread: How do I support light and dark mode on the DESKTOP? TiA Markus
Erel B4X founder Staff member Licensed User Longtime User May 25, 2021 #2 Markus Winter said: How do I support light and dark mode on the DESKTOP? Click to expand... I've found this open source project, which allows detecting the current theme: https://github.com/Dansoftowner/jSystemThemeDetector Its dependencies are a bit complex. I tested it on Windows and Mac and it works (there are errors on Mac in the logs but it still works). 1. Download the required jars: www.b4x.com/files/jSystemThemeDetector.zip and put them in the additional libraries folder. 2. See the attached example. Don't miss the #AdditionalJars and #PackagerProperty. You will need to handle the color changes yourself. A complex example, which changes the theme in B4A and B4i, is available here: https://www.b4x.com/android/forum/t...todon-pleroma-social-networks.124214/#content The same code will work in B4J. In that project I've used this tool to create the color palettes: https://www.b4x.com/android/forum/threads/dark-light-color-palette.114513/#content Attachments Test.zip Test.zip 2.3 KB · Views: 606 Last edited: Nov 1, 2021 Upvote 0
Markus Winter said: How do I support light and dark mode on the DESKTOP? Click to expand... I've found this open source project, which allows detecting the current theme: https://github.com/Dansoftowner/jSystemThemeDetector Its dependencies are a bit complex. I tested it on Windows and Mac and it works (there are errors on Mac in the logs but it still works). 1. Download the required jars: www.b4x.com/files/jSystemThemeDetector.zip and put them in the additional libraries folder. 2. See the attached example. Don't miss the #AdditionalJars and #PackagerProperty. You will need to handle the color changes yourself. A complex example, which changes the theme in B4A and B4i, is available here: https://www.b4x.com/android/forum/t...todon-pleroma-social-networks.124214/#content The same code will work in B4J. In that project I've used this tool to create the color palettes: https://www.b4x.com/android/forum/threads/dark-light-color-palette.114513/#content
mcqueccu Expert Licensed User Longtime User Nov 1, 2021 #3 @Erel the link to the required jar files is broken. Can you please upload or fix the link? Thank you Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Nov 1, 2021 #4 I've fixed the link. Upvote 0