Skip to content

[Win32] Switch Buttons between light and dark theme at runtime - #3865

Open
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:win32-button-dark-switch
Open

vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:win32-button-dark-switch

Conversation

@vogella

@vogella vogella commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Switching between the light and dark theme at runtime, through Display.setDarkThemePreferred or the useDarkModeExplorerTheme data key, only affected Buttons created afterwards, so existing Buttons kept the old theme until a restart.
Display now calls a new internal updateDarkSystemTheme hook for every control of the open shells when this setting changes, and Buttons use it to apply or remove the dark Explorer theme.
Buttons also stop caching the setting, so the size of their focus rectangle follows the current theme.
Other controls can use the same hook in follow-up changes.

Changing useDarkModeExplorerTheme through Display.setData now reaches existing controls through a new updateDarkSystemTheme hook, and Buttons use it to change their theme. Before, only Buttons created after the switch used the new theme.

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

Copy link
Copy Markdown
Contributor

Test Results (win32)

  181 files  +2    181 suites  +2   17m 37s ⏱️ + 4m 25s
5 189 tests +1  5 103 ✅ +1   86 💤 ±0  0 ❌ ±0 
5 385 runs  +2  5 129 ✅ +1  256 💤 +1  0 ❌ ±0 

Results for commit 2fddee0. ± Comparison against base commit 33f0960.

int inset = 2;
int radius = 3;
if (useDarkModeExplorerTheme && OsVersion.IS_WIN11_21H2) {
if (display.useDarkModeExplorerTheme && OsVersion.IS_WIN11_21H2) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we still support Windows 11?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do we still support Windows 11?

Yes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It the question about Windows 10? The current minimum version is the August 2016 update of Windows 10.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do we still support Windows 11?

If the question is about Windows 10, AFAIK we do not actively test it but we do not want to break it on purpose. IIRC I fixed a few Win10-only issues in the last 6 months.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It the question about Windows 10? The current minimum version is the August 2016 update of Windows 10.

Is it still tested somewhere? If not I think we should increase the minimum number at some point, working on win10 issues were hard and time consuming for me, as I had no way of checking the results.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My question was triggered by this OsVersion.IS_WIN11_21H2

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.

3 participants