Skip to content

Commit 4888468

Browse files
committed
Improved dark styling for buttons in workspace selection dialog
Skip the early dark-theme styling for Button controls in the workspace selection dialog at startup so buttons get the native macOS dark appearance instead, matching what the ThemeEngine applies later. Other widgets (Shell, Composite, Label, Link, ExpandableComposite) remain styled as before since the ThemeEngine is not yet available during workspace selection. On windows we still need to style the check buttons otherwise they look white. Fixes: #3905
1 parent ec728e7 commit 4888468

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application

bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEApplication.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
import org.eclipse.swt.SWT;
5959
import org.eclipse.swt.graphics.Color;
6060
import org.eclipse.swt.layout.FillLayout;
61+
import org.eclipse.swt.widgets.Button;
6162
import org.eclipse.swt.widgets.Composite;
6263
import org.eclipse.swt.widgets.Control;
6364
import org.eclipse.swt.widgets.Display;
@@ -952,6 +953,15 @@ private void applyDarkStyles(Shell shell) {
952953
}
953954

954955
private void applyStylesRecursive(Control control, Color bg, Color fg, Color linkColor) {
956+
if (control instanceof Button button) {
957+
// On Windows, check buttons need an explicit background; otherwise they
958+
// appear white because the parent background is not inherited.
959+
if (Platform.OS_WIN32.equals(Platform.getOS()) && (button.getStyle() & SWT.CHECK) != 0) {
960+
button.setBackground(bg);
961+
}
962+
// Leave other buttons unstyled so the native dark appearance is used
963+
return;
964+
}
955965
control.setBackground(bg);
956966
if (control instanceof Link link) {
957967
link.setLinkForeground(linkColor);

0 commit comments

Comments
 (0)