Skip to content

Skip gradient image for flat look in FormHeading and CSS handler#3808

Merged
vogella merged 2 commits intoeclipse-platform:masterfrom
vogella:flat-forms-level1-level4
Mar 30, 2026
Merged

Skip gradient image for flat look in FormHeading and CSS handler#3808
vogella merged 2 commits intoeclipse-platform:masterfrom
vogella:flat-forms-level1-level4

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented Mar 20, 2026

Summary

  • FormHeading (setTextBackground): Detect when all gradient colors are identical and use setBackground(color) instead of generating a gradient image via FormImages. This avoids unnecessary Image allocation and GC rendering for flat themes.
  • CSSPropertyFormHandler: Simplify identical-color gradient lists from CSS into a single-color array before passing to the form widget, preventing unnecessary gradient processing downstream.

These changes implement Levels 1 and 4 from #3803, complementing the Level 2/3 changes in #3807.

Fixes #3803

Test plan

  • Verify flat theme renders correctly with solid background (no gradient image created)
  • Verify gradient themes still render correctly with distinct colors
  • Verify CSS text-background-color with identical gradient stops uses solid background
  • Verify CSS text-background-color with distinct gradient stops still creates gradient

🤖 Generated with Claude Code

@eclipse-platform-bot
Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

bundles/org.eclipse.ui.forms/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From 02b42986fd5dbe0f2d3a2783c01646e42aca2c37 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Fri, 20 Mar 2026 13:54:30 +0000
Subject: [PATCH] Version bump(s) for 4.40 stream


diff --git a/bundles/org.eclipse.ui.forms/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui.forms/META-INF/MANIFEST.MF
index 22e1a339c7..b17c669780 100644
--- a/bundles/org.eclipse.ui.forms/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.ui.forms/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %name
 Bundle-SymbolicName: org.eclipse.ui.forms;singleton:=true
-Bundle-Version: 3.14.0.qualifier
+Bundle-Version: 3.14.100.qualifier
 Bundle-Vendor: %provider-name
 Bundle-Localization: plugin
 Export-Package: org.eclipse.ui.forms,
-- 
2.53.0

Further information are available in Common Build Issues - Missing version increments.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 20, 2026

Test Results

   852 files  ± 0     852 suites  ±0   54m 12s ⏱️ - 5m 54s
 7 890 tests + 6   7 647 ✅ + 7  243 💤 ±0  0 ❌  - 1 
20 172 runs  +18  19 516 ✅ +19  656 💤 ±0  0 ❌  - 1 

Results for commit 8dbb1d7. ± Comparison against base commit deaeb50.

♻️ This comment has been updated with latest results.

@vogella vogella force-pushed the flat-forms-level1-level4 branch from 54d9573 to 9cf24cd Compare March 23, 2026 14:12
@vogella
Copy link
Copy Markdown
Contributor Author

vogella commented Mar 23, 2026

Rebased onto eclipse/master and resolved merge conflicts in FlatLookTest.java. Fixed a bug in the FormHeading optimization where the background image wasn't being cleared correctly in all cases. Verified with mvn clean verify in forms test bundle.

@vogella vogella force-pushed the flat-forms-level1-level4 branch 2 times, most recently from 50e467e to ef413c9 Compare March 27, 2026 07:31
@vogella vogella marked this pull request as ready for review March 27, 2026 07:31
vogella added 2 commits March 30, 2026 12:41
…andler

FormHeading.setTextBackground now detects when all gradient colors are
identical and uses a solid background instead of generating a gradient
image. This avoids unnecessary image allocation and rendering overhead
for flat themes.

CSSPropertyFormHandler now simplifies identical-color gradient lists
from CSS into a single-color array before passing to the form widget,
preventing unnecessary gradient processing downstream.

Fixes eclipse-platform#3803
Section.updateHeaderImage now detects when the gradient color equals
the title bar background and skips creating the gradient image
entirely. This avoids unnecessary image allocation and tiling for
flat themes where both CSS properties are set to the same value.
@vogella vogella force-pushed the flat-forms-level1-level4 branch from ef413c9 to 8dbb1d7 Compare March 30, 2026 10:41
@vogella vogella merged commit e199306 into eclipse-platform:master Mar 30, 2026
18 checks passed
@vogella vogella deleted the flat-forms-level1-level4 branch March 30, 2026 14:57
vogella added a commit to vogella/eclipse.platform.ui that referenced this pull request Apr 30, 2026
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 eclipse-platform#3945
vogella added a commit that referenced this pull request Apr 30, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Requirement: Support for Truly Flat Look in Eclipse Forms UI

2 participants