Skip to content

Fix search dropdown theming - #19987

Merged
carlos-zamora merged 5 commits into
mainfrom
dev/cazamor/search/bugfix-theme
Mar 23, 2026
Merged

Fix search dropdown theming#19987
carlos-zamora merged 5 commits into
mainfrom
dev/cazamor/search/bugfix-theme

Conversation

@carlos-zamora

Copy link
Copy Markdown
Member

Summary of the Pull Request

Popups are in their own separate tree, so we had to find it and set the theme ourselves.

Validation Steps Performed

Prereq: Windows theme = light + terminal theme = dark
✅ settings search dropdown is dark theme

Closes #19927

@github-project-automation github-project-automation Bot moved this to To Cherry Pick in 1.25 Servicing Pipeline Mar 17, 2026
@carlos-zamora carlos-zamora moved this from To Cherry Pick to To Consider in 1.25 Servicing Pipeline Mar 17, 2026
Comment thread src/cascadia/TerminalSettingsEditor/MainPage.cpp Outdated

// GH#19927 - Theme the search box's internal popup now that the
// visual tree is ready and control templates are applied
const auto& theme = _settingsSource.GlobalSettings().CurrentTheme();

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.

(is it guaranteed that there is a theme?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

image

Good eye! I totally thought inheritance had my back and would never return null. Fixing.

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.

Only a good catch because we've exploded in exactly this way before :D

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok. Took a closer look. CurrentTheme() can't realistically return null, funny enough. We have the theme set in defaults.json so the theme setting is always set.

There's also _validateThemeExists() which ensures that _themes is always populated and we fall back to system/dark/light. We even have testing here.

UpdateBackgroundForMica() also has existing code that doesn't check and that's never been a problem either.

It's not the cleanest thing, but if you really want a null-check, I can add it haha. Just let me know :)

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.

Normally I'd say that the null check is beneficial regardless, but we have a lot of places that don't do null checks on WinRT object returns. Personally, I consider this fine.

Comment thread src/cascadia/TerminalSettingsEditor/MainPage.cpp Outdated
Comment thread src/cascadia/TerminalSettingsEditor/MainPage.cpp Outdated
@carlos-zamora
carlos-zamora merged commit c562dad into main Mar 23, 2026
20 checks passed
@carlos-zamora
carlos-zamora deleted the dev/cazamor/search/bugfix-theme branch March 23, 2026 18:05
@DHowett DHowett moved this from To Consider to To Cherry Pick in 1.25 Servicing Pipeline Mar 31, 2026
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.25 Servicing Pipeline Mar 31, 2026
DHowett pushed a commit that referenced this pull request Mar 31, 2026
## Summary of the Pull Request
Popups are in their own separate tree, so we had to find it and set the
theme ourselves.

## Validation Steps Performed
Prereq: Windows theme = light + terminal theme = dark
✅ settings search dropdown is dark theme

Closes #19927

(cherry picked from commit c562dad)
Service-Card-Id: PVTI_lADOAF3p4s4BQX0-zgnsPtk
Service-Version: 1.25
@DHowett DHowett moved this from Cherry Picked to Shipped in 1.25 Servicing Pipeline Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Settings search dropdown follows system theme and not app theme

3 participants