Skip to content

Lay out tab folder content when the CTabRendering padding changes - #4614

Merged
HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
HeikoKlare:ctabrendering-padding-notifies-client-area
Dec 6, 2026
Merged

HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
HeikoKlare:ctabrendering-padding-notifies-client-area

Conversation

@HeikoKlare

Copy link
Copy Markdown
Contributor

What & Why

When a theme or a CSS rule changes the padding of a tab folder at runtime, for example on a theme switch, the content of the selected tab keeps its old bounds until the folder is resized: it overlaps the new padding or leaves a gap next to it. Code that follows the folder's content area through its resize event, such as the editor onboarding area, is not told about the change either. CTabFolder reports content area changes it causes itself (since eclipse-platform/eclipse.platform.swt#3906 for all of them), but the padding is state of its renderer, which the folder cannot observe.

A padding change of CTabRendering that alters the folder's content area now lays out the selected tab's content right away and notifies the folder's resize listeners, the same way CTabFolder reports such a change itself. A padding change that leaves the content area as it is notifies nobody.

This is a prerequisite for #4556, which relies on the resize event to keep the editor onboarding area in place.

How to test

The selected tab's content follows a padding change at runtime.

  1. Open a Java editor and the CSS Scratchpad (Window > Show View > Other > General > CSS Scratchpad).
  2. Apply CTabFolder { padding: 10px; }.
  3. Without the change, the editor content keeps its previous size and overlaps the new padding until the editor area is resized. With the change, it moves in by the padding right away.

Screenshots

The same tab folder with CTabRendering and a red tab content after its padding changed from 0 to 30 px at runtime: on the left without this change (the content still covers the new padding and the frame), on the right with it (the content is inset by the padding).

image

HeikoKlare added a commit to HeikoKlare/eclipse.platform.ui that referenced this pull request Dec 5, 2026
With no editor open, an editor stack shows the perspective's onboarding
information in an area that covers the empty folder. That area was
placed with fixed offsets that assume one tab height and a thin border,
so it covered the frame of tab renderers with a different trim, such as
the rounded lower corners of a renderer that draws rounded frames, and
it was misplaced for other tab heights.

The onboarding area now fills exactly the space the folder leaves for
its content, so the folder's tabs and frame stay visible for any tab
height and renderer, also when the tab height, the renderer or its
padding changes at runtime.

The container is laid out in the folder's client area, which leaves out
the tabs and the frame the renderer draws, and is updated on the
folder's resize event. Following a new tab height or renderer relies on
CTabFolder sending that event for every change of its client area, which
SWT does since eclipse-platform/eclipse.platform.swt#3906, and following
a padding change relies on CTabRendering sending it, which
eclipse-platform#4614 adds. The ONBOARDING_TOP_SPACING
and ONBOARDING_SPACING constants are removed, as nothing uses them
anymore and the package is exported to friends only.

A client area change that sends no resize event, such as one of a
renderer that changes its trim on its own and only redraws, is not
followed.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@HeikoKlare
HeikoKlare force-pushed the ctabrendering-padding-notifies-client-area branch from bf3064d to 593603b Compare December 5, 2026 11:08
HeikoKlare added a commit to HeikoKlare/eclipse.platform.ui that referenced this pull request Dec 5, 2026
With no editor open, an editor stack shows the perspective's onboarding
information in an area that covers the empty folder. That area was
placed with fixed offsets that assume one tab height and a thin border,
so it covered the frame of tab renderers with a different trim, such as
the rounded lower corners of a renderer that draws rounded frames, and
it was misplaced for other tab heights.

The onboarding area now fills exactly the space the folder leaves for
its content, so the folder's tabs and frame stay visible for any tab
height and renderer, also when the tab height, the renderer or its
padding changes at runtime.

The container is laid out in the folder's client area, which leaves out
the tabs and the frame the renderer draws, and is updated on the
folder's resize event. Following a new tab height or renderer relies on
CTabFolder sending that event for every change of its client area, which
SWT does since eclipse-platform/eclipse.platform.swt#3906, and following
a padding change relies on CTabRendering sending it, which
eclipse-platform#4614 adds. The ONBOARDING_TOP_SPACING
and ONBOARDING_SPACING constants are removed, as nothing uses them
anymore and the package is exported to friends only.

A client area change that sends no resize event, such as one of a
renderer that changes its trim on its own and only redraws, is not
followed.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@HeikoKlare
HeikoKlare requested a balanced review from Copilot December 5, 2026 11:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No actionable issues were found in the reviewed changes.

No open issues 🎉

What changed in this PR

Updates Eclipse’s tab renderer so runtime padding changes immediately reposition selected-tab content and notify resize listeners. This supports the editor onboarding placement changes in #4556.

Changes:

  • Trigger resize notification and layout only when padding changes the folder’s client area.
  • Add tests for content bounds, resize notification, and unchanged padding.
File Description
tests/​org.eclipse.e4.ui.tests/​src/​org/​eclipse/​e4/​ui/​workbench/​renderers/​swt/​CTabRenderingTest.java Tests content layout and resize events after padding updates.
bundles/​org.eclipse.e4.ui.workbench.renderers.swt/​src/​org/​eclipse/​e4/​ui/​workbench/​renderers/​swt/​CTabRendering.java Notifies listeners and lays out content when padding changes the client area.

Review effort: Balanced

@github-actions

github-actions Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ±0     867 suites  ±0   53m 42s ⏱️ - 1m 47s
 8 640 tests +2   8 400 ✅ +2  240 💤 ±0  0 ❌ ±0 
21 789 runs  +6  21 116 ✅ +6  673 💤 ±0  0 ❌ ±0 

Results for commit 28fb1a0. ± Comparison against base commit 2640004.

♻️ This comment has been updated with latest results.

@HeikoKlare
HeikoKlare marked this pull request as ready for review December 5, 2026 15:54
When a theme or a CSS rule changes the padding of a tab folder at
runtime, for example on a theme switch, the content of the selected tab
keeps its old bounds until the folder is resized: it overlaps the new
padding or leaves a gap next to it. Code that follows the folder's
content area through its resize event, such as the editor onboarding
area, is not told about the change either.

A padding change that alters the folder's content area now lays out the
selected tab's content right away and notifies the folder's resize
listeners, the same way the folder reports a content area change it
causes itself, for example through a new tab height.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
HeikoKlare added a commit to HeikoKlare/eclipse.platform.ui that referenced this pull request Dec 5, 2026
With no editor open, an editor stack shows the perspective's onboarding
information in an area that covers the empty folder. That area was
placed with fixed offsets that assume one tab height and a thin border,
so it covered the frame of tab renderers with a different trim, such as
the rounded lower corners of a renderer that draws rounded frames, and
it was misplaced for other tab heights.

The onboarding area now fills exactly the space the folder leaves for
its content, so the folder's tabs and frame stay visible for any tab
height and renderer, also when the tab height, the renderer or its
padding changes at runtime.

The container is laid out in the folder's client area, which leaves out
the tabs and the frame the renderer draws, and is updated on the
folder's resize event. Following a new tab height or renderer relies on
CTabFolder sending that event for every change of its client area, which
SWT does since eclipse-platform/eclipse.platform.swt#3906, and following
a padding change relies on CTabRendering sending it, which
eclipse-platform#4614 adds. The ONBOARDING_TOP_SPACING
and ONBOARDING_SPACING constants are removed, as nothing uses them
anymore and the package is exported to friends only.

A client area change that sends no resize event, such as one of a
renderer that changes its trim on its own and only redraws, is not
followed.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@HeikoKlare
HeikoKlare force-pushed the ctabrendering-padding-notifies-client-area branch from 593603b to 28fb1a0 Compare December 5, 2026 16:34
@HeikoKlare
HeikoKlare merged commit db49304 into eclipse-platform:master Dec 6, 2026
18 checks passed
@HeikoKlare
HeikoKlare deleted the ctabrendering-padding-notifies-client-area branch December 6, 2026 13:21
HeikoKlare added a commit to HeikoKlare/eclipse.platform.ui that referenced this pull request Dec 6, 2026
With no editor open, an editor stack shows the perspective's onboarding
information in an area that covers the empty folder. That area was
placed with fixed offsets that assume one tab height and a thin border,
so it covered the frame of tab renderers with a different trim, such as
the rounded lower corners of a renderer that draws rounded frames, and
it was misplaced for other tab heights.

The onboarding area now fills exactly the space the folder leaves for
its content, so the folder's tabs and frame stay visible for any tab
height and renderer, also when the tab height, the renderer or its
padding changes at runtime.

The container is laid out in the folder's client area, which leaves out
the tabs and the frame the renderer draws, and is updated on the
folder's resize event. Following a new tab height or renderer relies on
CTabFolder sending that event for every change of its client area, which
SWT does since eclipse-platform/eclipse.platform.swt#3906, and following
a padding change relies on CTabRendering sending it, which
eclipse-platform#4614 adds. The ONBOARDING_TOP_SPACING
and ONBOARDING_SPACING constants are removed, as nothing uses them
anymore and the package is exported to friends only.

A client area change that sends no resize event, such as one of a
renderer that changes its trim on its own and only redraws, is not
followed.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants