Skip to content

Fix dark styling of Copy Settings checkboxes on macOS (#3897)#3899

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:fix/issue-3897-dark-copy-settings
Apr 17, 2026
Merged

Fix dark styling of Copy Settings checkboxes on macOS (#3897)#3899
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:fix/issue-3897-dark-copy-settings

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented Apr 17, 2026

Summary

Fixes #3897 — macOS-only rendering regression in the "Copy Settings" section of the workspace selection dialog.

The section's SWT.CHECK buttons are created eagerly inside a sectionClient composite that is hidden on first launch (ChooseWorkspaceWithSettingsDialog.java:151-153). The E4 CSS theme engine styles them at creation time, but on macOS Cocoa, setBackground / setForeground calls made on an unrealized (hidden) widget are not retained once the widget is realized. When the user expands the section the checkboxes paint with default native light colors — the bright rectangles visible in the screenshot attached to the issue.

GTK and Windows retain widget color state across realize, so they render correctly without any workaround.

Fix

In ChooseWorkspaceWithSettingsDialog.createSettingsControls, attach an SWT.Show listener on sectionClient that re-applies workArea.getBackground() / workArea.getForeground() to its SWT.CHECK children when it first becomes visible. Guarded by Util.isMac(); no-op on GTK and Windows. No public API change.

Placing the workaround in the dialog (rather than in IDEApplication.applyStylesRecursive) matches where the styling actually originates at runtime: when the dialog is opened from OpenWorkspaceAction inside a running workbench, it is the CSS theme engine — not IDEApplication — that supplies the colors.

Diagnostic process

Standalone SWT snippets isolated the Cocoa hidden-widget setBackground quirk against the setVisible(false) → expand scenario. Fix was validated against the snippet; @Phillipus confirmed snippet behavior fixes the issue.

Test plan

  • On macOS dark theme: open workspace selection dialog → expand "Copy Settings" → checkboxes render dark like the rest of the dialog.
  • On Linux GTK dark theme: same scenario, no regression.
  • On Windows dark theme: same scenario, no regression.
  • Light theme unaffected on all platforms (listener only reads parent colors; no theme detection in this path).

@akurtakov akurtakov assigned akurtakov and unassigned akurtakov Apr 17, 2026
@vogella vogella marked this pull request as ready for review April 17, 2026 13:13
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 2026

Test Results

   852 files  ±0     852 suites  ±0   55m 51s ⏱️ + 2m 23s
 7 899 tests ±0   7 656 ✅ ±0  243 💤 ±0  0 ❌ ±0 
20 199 runs  ±0  19 544 ✅ ±0  655 💤 ±0  0 ❌ ±0 

Results for commit c901990. ± Comparison against base commit 39cf286.

♻️ This comment has been updated with latest results.

On macOS Cocoa, setBackground/setForeground applied to a widget that is
currently hidden is not retained once the widget is realized. The "Copy
Settings" section of ChooseWorkspaceWithSettingsDialog is created with
setVisible(false), so the theme-engine colors on its check buttons are
dropped and the buttons paint with the default light system colors when
the user expands the section on a dark theme.

Re-apply the parent background/foreground to the check buttons when the
section first becomes visible. Guarded with Util.isMac() since GTK and
Windows retain the colors across realize and do not need this workaround.

Fixes eclipse-platform#3897
@vogella vogella force-pushed the fix/issue-3897-dark-copy-settings branch from bdba619 to c901990 Compare April 17, 2026 14:35
@vogella vogella merged commit 9b991c8 into eclipse-platform:master Apr 17, 2026
18 checks passed
@vogella vogella deleted the fix/issue-3897-dark-copy-settings branch April 17, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workspace selection dialog not rendered correctly in dark theme

3 participants