Skip to content

Style CTabFolder pages that are hidden when they are skinned - #4331

Open
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:ctabfolder-page-initial-styling
Open

Style CTabFolder pages that are hidden when they are skinned#4331
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:ctabfolder-page-initial-styling

Conversation

@vogella

@vogella vogella commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The Search dialog opens unstyled in the dark theme and only picks up the theme once a tab is switched. A CTabFolder exposes only the page of its selected tab to the CSS engine, and applyStyles skips elements that are not visible. SearchDialog attaches its page before selecting the tab, so the page is hidden during the skin pass, and the programmatic setSelection afterwards fires no selection event. A page whose creation runs the event loop is skinned before it is attached at all, and attaching it to an already selected tab sends no show event either.

CSSSWTApplyStylesListener now watches a skipped CTabFolder child for the resize or show that makes it the selected tab's page and styles it then. CTabFolderElement is the only ChildVisibilityAwareElement, so this covers the whole class of the problem.

Two CTabFolderTest cases mirror the dialog's two sequences and fail without the fix. The swt-simple test is dropped, curved tabs are gone and getSimple() always returns true. Verified with CTabFolderTest (21 tests) on Linux.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Test Results

   858 files  ±0     858 suites  ±0   1h 2m 47s ⏱️ + 6m 41s
 8 249 tests +1   8 006 ✅ +1  243 💤 ±0  0 ❌ ±0 
20 616 runs  +3  19 946 ✅ +3  670 💤 ±0  0 ❌ ±0 

Results for commit 9f90fae. ± Comparison against base commit c249437.

This pull request removes 1 and adds 2 tests. Note that renamed tests count towards both.
org.eclipse.e4.ui.tests.css.swt.CTabFolderTest ‑ testSimple
org.eclipse.e4.ui.tests.css.swt.CTabFolderTest ‑ testPageAttachedToItsItemAfterSkinningIsStyled
org.eclipse.e4.ui.tests.css.swt.CTabFolderTest ‑ testPageSelectedProgrammaticallyAfterSkinningIsStyled

♻️ This comment has been updated with latest results.

@vogella

vogella commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Before:

pr4331-before

After:

pr4331-after-screen

@vogella
vogella marked this pull request as ready for review September 1, 2026 15:27
@vogella
vogella force-pushed the ctabfolder-page-initial-styling branch from 904b52a to e7045c4 Compare September 1, 2026 15:29
The Search dialog opened unstyled until a tab was switched. A CTabFolder
exposes only the page of its selected tab to the CSS engine, and
applyStyles skips an element that is not visible. SearchDialog attaches
its page before selecting the tab, so the page is hidden during the skin
pass, and the programmatic setSelection that follows fires no selection
event. A page whose creation runs the event loop is skinned before it is
attached at all, and attaching it to an already selected tab sends no
show event either.

Watch a skipped CTabFolder child for the resize or show that makes it
the selected tab's page and style it then.

Also drop the swt-simple test: curved tabs are gone, so getSimple()
always returns true and the assertion tested nothing.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella
vogella force-pushed the ctabfolder-page-initial-styling branch from e7045c4 to 9f90fae Compare September 3, 2026 11:15
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