Bug 571069 - The background color does not change for SWT widgets when I switch between Dark/Light Mode on macOS
Summary: The background color does not change for SWT widgets when I switch between Da...
Status: CLOSED DUPLICATE of bug 547316
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.20   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-09 13:52 EST by Hubert Gajewski CLA
Modified: 2021-02-09 17:53 EST (History)
1 user (show)

See Also:


Attachments
When the Light Mode was changed to the Dark Mode (317.02 KB, image/png)
2021-02-09 13:52 EST, Hubert Gajewski CLA
no flags Details
When the Dark Mode was changed to the Light Mode (199.18 KB, image/png)
2021-02-09 13:53 EST, Hubert Gajewski CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hubert Gajewski CLA 2021-02-09 13:52:30 EST
Created attachment 285496 [details]
When the Light Mode was changed to the Dark Mode

Steps to reproduce:
1. Set Light Mode in macOS preferences
2. Run SWT app with widgets containing the text (I tested Label, Text and Button)
3. Set Dark Mode in macOS preferences

Result:
The text color has been changed. The background has not been changed for most of widgets. The text is unreadable.

Expected:
The text color has been changed. The background has been changed for all widgets. The text is readable.


Alternate scenario (the results are a little bit different):
1. Set Dark Mode in macOS preferences
2. Run SWT app
3. Set Light Mode in macOS preferences

Sample code:

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.*;

public class Main
{
    public static void main(String[] args)
    {
        Display display = new Display();
        Shell shell = new Shell(display);
        shell.setLayout(new FillLayout());
        Label label = new Label(shell, SWT.NONE);
        label.setText("Sample label widget");
        Button button = new Button(shell, SWT.PUSH);
        button.setText("Sample button widget");
        Text text = new Text(shell, SWT.NONE);
        text.setText("Sample text widget");
        shell.setSize(600, 480);
        shell.open();
        while (!shell.isDisposed())
        {
            if (!display.readAndDispatch())
            {
                display.sleep();
            }
        }
        display.dispose();
    }
}
Comment 1 Hubert Gajewski CLA 2021-02-09 13:53:13 EST
Created attachment 285497 [details]
When the Dark Mode was changed to the Light Mode
Comment 2 Lakshmi P Shanmugam CLA 2021-02-09 17:53:01 EST
Dynamic switching of Light/Dark modes in SWT is not yet supported.

*** This bug has been marked as a duplicate of bug 547316 ***