B4J Question How can the background color of any form titlebar be set to match themes?

m4.s

Member
Licensed User
Longtime User
All the CSS theme-related threads in the B4J forum never discussed/address how to do this.

For my application's main form (and all its popup forms and msgboxes), I have a nice dark theme in place and working for everything necessary using the:

B4X:
form.Stylesheets.Add(File.GetUri(File.DirAssets,Theme))

approach -- except for the the form titlebar:

1604719569409.png


In the above, I want to be set the titlebar to match the background color I've set for the menubar (with white color for text). I would have thought the

Any CSS or other solution suggestion(s) will be much appreciated.

Note: I do NOT want to create a custom replacement titlebar....
 

stevel05

Expert
Licensed User
Longtime User
Unfortunately the windows Titlebar colour is handled by the OS. If you search the internet you will find a lot of discussion about this issue related to Java / JavaFX. It is possible that a solution could lie with the Java Native Interface (JNI/JNA) but I have yet to find an explanation or example of how it could be done. The most common suggested solution is to create a replacement Titlebar, which as you intimate, is not ideal. If you can find an example of a working solution related to JavaFX, I would certainly be happy to try and help you implement it (if you need help).
 
Upvote 0
Top