Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.Util;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
Expand Down Expand Up @@ -153,6 +154,20 @@ private void createSettingsControls(Composite workArea) {
clientData.exclude = !expanded;
toggle.setText(expanded ? "\u25BE" : "\u25B8"); //$NON-NLS-1$ //$NON-NLS-2$

// On macOS Cocoa, setBackground/setForeground on a hidden widget is dropped
// once the widget is realized. Re-apply colors to the check buttons when
// the section first becomes visible.
if (Util.isMac()) {
sectionClient.addListener(SWT.Show, e -> {
for (Control child : sectionClient.getChildren()) {
if (child instanceof Button button && (button.getStyle() & SWT.CHECK) != 0) {
button.setBackground(workArea.getBackground());
button.setForeground(workArea.getForeground());
}
}
});
}

Listener toggleListener = e -> {
boolean newState = !sectionClient.getVisible();
sectionClient.setVisible(newState);
Expand Down
Loading