From 765dd208ec62c152dc382cb842512e4b2f3a1e96 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Thu, 30 Apr 2026 06:08:58 +0200 Subject: [PATCH] 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 --- .../src/org/eclipse/ui/forms/widgets/Section.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/Section.java b/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/Section.java index e9ef4675c63..addb92ebb54 100644 --- a/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/Section.java +++ b/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/Section.java @@ -464,11 +464,12 @@ protected void onPaint(PaintEvent e) { } private void updateHeaderImage(Color bg, Rectangle bounds, int theight, int realtheight) { Color gradient = getTitleBarGradientBackground() != null ? getTitleBarGradientBackground() : getBackground(); - if (gradient.equals(bg)) { - // Flat look: gradient and background are the same, no image needed + if (gradient.equals(bg) && bg.equals(getBackground())) { + // Section is uniform; the body background already fills everything. super.setBackgroundImage(null); return; } + // Image paints the title bar contrast against the section body. Image image = FormImages.getInstance().getSectionGradientImage(gradient, bg, realtheight, theight, marginHeight, getDisplay()); super.setBackgroundImage(image);