Closed laalsaas closed 3 years ago
Thanks for the hint. It is not really easy to have all the possible look and feel themes in mind all the time for all possible platforms, in particular, as some of them, especially Nimbus, work with unbelievable tweaks around the Swing standard mechanisms. We will have a look into it. As a temporary workaround, please just choose another look and feel in Structorizer.
Just an explanation: The decision not to use the standard background colour was made because with most of the light themes, the code preview would have been fully ablaze next to the diagram, competing with it for the user's attention, which was considered inconvenient, too. We will find a solution that ensures enough contrast between text and "paper".
The same problem applies to the Arranger index, and even the element editor is hard to use because the caret symbol is black on very dark gray:
For these effects Structorizer can hardly be blamed - we use standard behaviour of JTextArea and JTree here! This looks rather as if the coordination between GTK+ theme and Java Swing wouldn't work in an optimal way. As already mentioned: Many look and feels use bypasses. So is it actually the task of the application to compensate this? Our code already contains several workarounds for nasty look and feels. I hesitate to add even more of them.
It gets even more funny: Two instances of Structorizer in the same process behave differently (see red and green box):
Just some remarks (to be continued):
After having installed a fresh Debian 10, it wasn't so mysterious anymore (and the toolbar layout looks normal again, the icon artefacts being still ugly, though) and the solution for the L&F change notification turned out easier than expected. The problem of the highlighting remains — see screenshot:
I see three possible solutions:
I will try approach 2 and have workaround 3 as fallback in mind.
Well, approch 3 yields the best ratio between effect and effort for the code preview and will be implemented with version 3.31-03:
In other related cases (like Find & Replace, see screenshot below) we may just dim the highlight colours instead.
In case of a dark theme the inactive highlighting in Find&Replace will just be gray (instead of yellow), the emphasized highlighting remains orange:
In Translator, the highlighting colours already provide enough contrast for readability with a dark theme, no adptations necessary. The Executor output window has always had a black background, so there all is fine as well.
Most of the untidy icons have now been revised such that they are functional in dark L&F theme. This included some slight colour modifications or sets of alternative icons for dark themes (like the snap mode icons in the Turtleizer status bar):
On this occasion I became aware that there is no dark standard L&F for Swing that would step in on a Windows platform, which happens to be run in dark color mode.
A possible solution might be to integrate a free product like FlatLaf by FormDev GmbH (which is known for its JFormDesigner). Then Structorizer could always offer two dark (and two additional light) Look and Feels. The price for this "fashion service" would be a size increase by about half a MiB:
If you set look and feel to GTK+ and use a dark theme e.g. "breeze dark", the code preview font has the theme color: white and the background of the code preview still uses the same Blueish grey. This way, you can barely see the code. I think it would be best do set the background color of the code preview also from the GTk-theme![Screenshot_20210308_150215](https://user-images.githubusercontent.com/43275254/110331520-7f1ed280-801f-11eb-8c3d-a27216bd062e.png)