Skip to content
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

[Dark Theme] Checkbox created with toolkit on dialog has wrong background #416

Open
marcushoepfner opened this issue Oct 17, 2022 · 12 comments
Labels
macOS happens on macOS

Comments

@marcushoepfner
Copy link
Contributor

marcushoepfner commented Oct 17, 2022

A button with SWT.CHECK gets a wrong background color (light grey instead of dark grey) under the following conditions:

  • created on a dialog
  • toolkit used (FormToolkit.createButton)
  • darktheme

In an editor this does not happen.

Screenshot 2022-10-17 at 13 30 50

Does happen on Mac. Not on Windows.

@akurtakov
Copy link
Member

Can you share the snippet to reproduce?

@marcushoepfner
Copy link
Contributor Author

sure.
background.test_1.0.0.202210171431.zip

(It's actually a jar, but github does not support. You might need to rename back to .jar)

@marcushoepfner
Copy link
Contributor Author

I have started analyzing this:

  • FormToolkit calls adapt() when creating the checkbox; a background color is set
  • afterwards the css engine overwrites this background color via Control.setBackground(Color color) with null
  • this leads to the light grey eventually

Compared to e.g. a label created with toolkit

  • FormToolkit calls adapt() when creating the label; a background color is set
  • afterwards the css engine overwrites this background color via Control.setBackground(Color color) with a concrete color

Is just the color in css missing?

@marcushoepfner
Copy link
Contributor Author

Does someone has a hint how to fix this? If so, I can take over and try.

@akurtakov
Copy link
Member

Can you share the code for this jar so it can be used for debugging?

@marcushoepfner
Copy link
Contributor Author

marcushoepfner commented Oct 19, 2022

Oh damn. I forgot. Thanks for bearing with me.
Here it is, same disclaimer: rename from zip to jar
background.test.source_1.0.0.202210191250.zip

@marcushoepfner
Copy link
Contributor Author

Hi, any progress on this one?

@akurtakov akurtakov added the macOS happens on macOS label Dec 14, 2023
@akurtakov
Copy link
Member

Unfortunately not many people look into MacOS specific issues (@Phillipus only lately) . In my opinion this could be SWT bug but it could be css styling issue too. In order to get this issue moving people with interest (and access) in MacOS have to step up but you can further help by trying to reduce the snippet to pure SWT snippet one .

@Phillipus
Copy link
Contributor

not sure whether it happens on Windows.

OK on Windows:

Image 001

reduce the snippet to pure SWT snippet one .

Not sure if that's possible as it depends on dark theme and Theming framework.

@marcushoepfner Perhaps you might investigate the dark *.css files in the theme plug-in to see if any change required there?

@BeckerWdf
Copy link
Contributor

I even see issues in the light theme on macOS:

image

@marcushoepfner
Copy link
Contributor Author

Better Checkbox Coloring on Dialog when using FormToolkit #2474

Correct. I've seen this as well. There is also an issue with light theme.

@BeckerWdf
Copy link
Contributor

I even see issues in the light theme on macOS:

image

It looks the same when theming is "turned off" in the preferences. The widget should always look correct also when theming is off. So fixing this via CSS feels wrong to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS happens on macOS
Projects
None yet
Development

No branches or pull requests

4 participants