Skip to content

Support per-tab CTabItem background colors in CTabRendering and CSS - #4606

Draft
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:ctabitem-background-colors
Draft

vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:ctabitem-background-colors

Conversation

@vogella

@vogella vogella commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Uses the per-item background colors of CTabItem added in SWT 3.137.0 (eclipse-platform/eclipse.platform.swt#3866), so RCP applications can color individual tabs through the API or CSS without subclassing CTabRendering with reflection. CTabRendering now paints these colors and offers two overridable methods for the highlight and hover colors, while tabs without item colors look as before. CSS background-color rules on CTabItem now apply to the item instead of the whole folder, and the built-in themes are adjusted accordingly.

Draft until an I-build provides SWT 3.137.0.

Use the per-item background color APIs added to CTabItem in SWT 3.137.0
(eclipse-platform/eclipse.platform.swt#3866) so Eclipse RCP applications
can color individual tabs without subclassing CTabRendering with
reflection:

- Bump org.eclipse.swt minimum version to [3.137.0,4.0.0) in
  org.eclipse.e4.ui.workbench.renderers.swt and org.eclipse.e4.ui.css.swt.
- Render CTabItem.getSelectionBackground() and CTabItem.getBackground()
  in CTabRendering across selected, unselected, hovered, single-tab,
  SWT.BOTTOM, and inactive folder states while keeping the content area
  behind editor composites folder-colored and preserving outer keylines.
- Add protected getSelectedTabHighlightRGB(CTabItem) and
  getHotUnselectedTabBackgroundRGB(CTabItem) hooks on CTabRendering with
  luminance-aware contrasting defaults for colored tabs.
- Update CSSPropertyBackgroundSWTHandler to apply solid CTabItem and
  CTabItem:selected background-color rules per item, check item colors
  before falling back to CTabFolder on retrieval, and keep folder
  fallback for CssList gradients.
- Track CSS-applied CTabItem background RGBs in CSSSWTColorHelper so
  CTabItemElement.reset() clears CSS-applied colors on theme switch
  without clobbering programmatically set item colors.
- Migrate built-in Light and Dark themes in org.eclipse.ui.themes off
  legacy CTabItem background-color rules and exclude CTabItem from dark
  theme 'Composite > * > *' wildcard rules.
- Add pixel tests in CTabRenderingTest and CSS tests in CTabItemTest and
  CTabItemSelectionTest.
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ± 0     867 suites  ±0   42m 19s ⏱️ - 22m 55s
 8 617 tests +10   8 377 ✅ +10  240 💤 ±0  0 ❌ ±0 
21 720 runs  +30  21 047 ✅ +30  673 💤 ±0  0 ❌ ±0 

Results for commit 93a731c. ± Comparison against base commit 6863d5e.

♻️ This comment has been updated with latest results.

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