IconWUX: let callers set icon size instead of defaulting to 32×32 (#19806)#20125
Open
R-Alothaim wants to merge 4 commits intomicrosoft:mainfrom
Open
IconWUX: let callers set icon size instead of defaulting to 32×32 (#19806)#20125R-Alothaim wants to merge 4 commits intomicrosoft:mainfrom
R-Alothaim wants to merge 4 commits intomicrosoft:mainfrom
Conversation
…l sites Fixes microsoft#19806. IconWUX() hardcoded Width(32)/Height(32) on ImageIcon elements from binary icon paths, forcing every caller to override. This removes the hardcoded size and adds explicit Width(16)/Height(16) at all call sites that previously relied on the default. Retains the manual FontIcon construction in SearchIndex.cpp for the generic extension icon to preserve its FontSize(iconSize) behavior. Removes stale comments referencing the old default.
Author
|
@microsoft-github-policy-service agree |
Member
|
Hmmm. We initially made |
Author
|
Ah, didn't know that history, thanks. Pushed a commit keeping |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
IconPathConverter::IconWUX()was hardcodingWidth(32)/Height(32)on every icon it returned. Some call sites were already overriding that to 16×16 with a comment explaining why; others just got stuck with 32×32.This drops the hardcoded size and has every caller set its own
Width/Height— 16×16 across the board, matching what the overriding callers were already using.References and Relevant Issues
Fixes #19806
Detailed Description of the Pull Request / Additional comments
Callers that were already setting 16×16 — just dropped the stale "IconWUX sets 32 by default" comment:
BasePaletteItem.hProfileViewModel.cppNewTabMenuViewModel.cppSearchIndex.cppCallers that previously got 32×32 by default and now set 16×16 themselves:
TerminalPage.cpp— new-tab dropdown, pane context menu, quick-fix menuMainPage.cpp— profile nav entriesSearchIndex.cppalso had a// TODO GH #19806comment that's no longer relevant; removed.Validation Steps Performed
This is my first contribution to the repo, so I wanted to be thorough. Built locally (VS 2022, Debug x64) and walked through every UI surface that renders icons from these call sites, comparing against the current Store release. Left side of each image is Store, right is this branch.
New-tab dropdown
Right-click pane context menu
Settings → profile nav
Profile page icon + left-nav updating after changing the icon
New Tab Menu folder icon (newer feature than the current Store build — just showing the fork renders it at a sensible size)
Command palette
Settings search (also newer than the Store release)
Couldn't reproduce the quick-fix menu locally — I don't have winget shell integration set up. Same
IconWUX+ explicit 16×16 pattern as the surfaces above.PR Checklist
First contribution to Windows Terminal, it's an honor to put up a patch on a Microsoft open-source project. Thanks in advance for the review.