Skip to content
Draft
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 @@ -26,6 +26,7 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
Expand Down Expand Up @@ -468,6 +469,25 @@ protected void createControl(Composite parent, int styles) {
if (fOverviewRuler != null) {
fOverviewRuler.createControl(fComposite, this);
}

if (fComposite != null) {
StyledText textWidget= getTextWidget();
if (textWidget != null) {
// Match the canvas background to the text widget so the RulerLayout gap blends in.
syncCompositeBackground(textWidget);
textWidget.addPaintListener(e -> syncCompositeBackground(textWidget));
}
}
}

private void syncCompositeBackground(StyledText textWidget) {
if (fComposite == null || fComposite.isDisposed() || textWidget.isDisposed()) {
return;
}
Color desired= textWidget.getBackground();
if (desired != null && !desired.equals(fComposite.getBackground())) {
fComposite.setBackground(desired);
}
}

/**
Expand Down
Loading