Skip to content

[CTabFolder] Ask the renderer for the background of tab controls - #3548

Draft
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:ctabfolder-bkimage-tests
Draft

[CTabFolder] Ask the renderer for the background of tab controls#3548
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:ctabfolder-bkimage-tests

Conversation

@vogella

@vogella vogella commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

A control placed in a CTabFolder with setTopRight was given the flat getBackground() whenever no gradient was set, and always when it had wrapped below the tab row. That assumes the folder background is a flat color at that position, which only holds for the built-in renderer. A renderer painting its own PART_BACKGROUND, as the IDE's CTabRendering does, uses different colors for the tab row and the body, so a view tool bar that wrapped showed a block of the tab row color sitting on the body strip.

The folder now asks a custom renderer for the background at the control's position, which is the path the gradient case already used, and keeps the flat shortcut for the built-in renderer. The image is prefilled with getBackground() first, because a renderer may leave pixels untouched where on screen the widget background shows through; without that a renderer subclass that does not override PART_BACKGROUND would hand out a blank image.

Snippet396 reproduces it with a two tone renderer. Four tests cover the wrapped case, the non-wrapped case without a gradient, a renderer that keeps the default background, and the built-in renderer with a gradient.

Verified on GTK, including in a running IDE with the patched bundle substituted in: the wrapped tool bar goes from a flat tab row color to the rendered folder background. Note that themes which set swt-draw-custom-tab-content-background: false make the band match the folder background anyway, so this is not visible there.

updateBkImages() handed a control the flat getBackground() when it was
wrapped below the tab row, or when no gradient was set. That only holds for
the built-in renderer. One painting its own PART_BACKGROUND, like the IDE's
CTabRendering, uses different colors for tab row and body, so a wrapped view
tool bar showed a block of the tab row color on the body strip.

A custom renderer is now asked for the background. The image is prefilled
with getBackground() first, since a renderer may leave pixels untouched that
on screen show the widget background.

Adds Snippet396.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

  210 files   -  2    210 suites   - 2   26m 2s ⏱️ - 1m 9s
4 916 tests + 4  4 889 ✅ + 3   26 💤 ±0  1 ❌ +1 
7 088 runs   - 12  6 909 ✅  - 11  178 💤  - 2  1 ❌ +1 

For more details on these failures, see this check.

Results for commit 763c523. ± Comparison against base commit 2a8d3f1.

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.

1 participant