-
-
Notifications
You must be signed in to change notification settings - Fork 256
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
Switching from another look-and-feel sometimes creates inconsistent combobox visuals #17
Comments
Good catch 👍 The problem is that the It is always a problem when a LaF changes something in the component and does not restore it correctly. There is a similar problem with Windows LaF (in Java 9 and later), that sets a non-UIResouce EmptyBorder at the combobox. When switching from Windows LaF to FlatLaf the combobox borders are gone: Probably have to remember what LaF was active before switching to FlatLaf to fix those issues... |
I'm guilty of not restoring that in Substance as well (for combo boxes). I do it for some other controls (like buttons), storing the original opacity when the UI delegate is installed, and resetting it when it is uninstalled. The thing I don't like about this is what happens when the application code calls setOpacity in the middle of the app "flow". I have an explicit FAQ entry saying that apps shouldn't do that. Probably I should restore the opacity bit for comboboxes. |
For the opaque property, the solution is to use following in LookAndFeel.installProperty( comboBox, "opaque", Boolean.FALSE); (change last parameter to This invokes But this works only correctly if the BasicXyzUI (or all other LaFs) also invokes this method, to reset opaque when switching to another LaF. |
Unfortunately with how Substance paints the control visuals (rounded corners, partial translucency in some cases), I have to set opacity to false no matter what the application "preference" is. |
I see. Because of the round corners? In FlatLaf are also round corners. And "focused" borders outside of the components (in Darcula and IntelliJ themes). But the components are opaque. The trick I use (borrowed from IDEA) is to fill the background of the component with the the background color of a non-opaque parent. Works fine as long as the panel uses a solid color. Will fail for gradient or image backgrounds... |
Right, my preference is to say that Substance doesn't play well with application calls to |
fixed in master
|
fixed in 0.17 |
See how the background behind the arrows is darker than the rest of the combobox fill.
The text was updated successfully, but these errors were encountered: