Skip to content

Commit 2f4f230

Browse files
committed
Restore Section title bar background lost after #3808
Section.updateHeaderImage was skipping the title-bar image whenever the title-bar gradient color matched the title-bar background color. That condition is too loose: the title-bar background is typically set distinct from the section body (e.g. #eaeaea on a #ffffff body in the light theme) and the image was what painted that contrast across the title-bar area. After the optimization fired, the title bar collapsed into the section body color and the visual cue was gone. Tighten the short-circuit to require all three of gradient color, title-bar background and section body background to be equal before skipping the image. This preserves the optimization for genuinely flat sections while restoring the prior look when the title-bar is meant to contrast with the body. Fixes #3945
1 parent f2e2f88 commit 2f4f230

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets

bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/Section.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,11 +464,12 @@ protected void onPaint(PaintEvent e) {
464464
}
465465
private void updateHeaderImage(Color bg, Rectangle bounds, int theight, int realtheight) {
466466
Color gradient = getTitleBarGradientBackground() != null ? getTitleBarGradientBackground() : getBackground();
467-
if (gradient.equals(bg)) {
468-
// Flat look: gradient and background are the same, no image needed
467+
if (gradient.equals(bg) && bg.equals(getBackground())) {
468+
// Section is uniform; the body background already fills everything.
469469
super.setBackgroundImage(null);
470470
return;
471471
}
472+
// Image paints the title bar contrast against the section body.
472473
Image image = FormImages.getInstance().getSectionGradientImage(gradient, bg, realtheight,
473474
theight, marginHeight, getDisplay());
474475
super.setBackgroundImage(image);

0 commit comments

Comments
 (0)