Skip to content

IconWUX: let callers set icon size instead of defaulting to 32×32 (#19806)#20125

Open
R-Alothaim wants to merge 4 commits intomicrosoft:mainfrom
R-Alothaim:fix/icon-size-refactor
Open

IconWUX: let callers set icon size instead of defaulting to 32×32 (#19806)#20125
R-Alothaim wants to merge 4 commits intomicrosoft:mainfrom
R-Alothaim:fix/icon-size-refactor

Conversation

@R-Alothaim
Copy link
Copy Markdown

Summary of the Pull Request

IconPathConverter::IconWUX() was hardcoding Width(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.h
  • ProfileViewModel.cpp
  • NewTabMenuViewModel.cpp
  • SearchIndex.cpp

Callers that previously got 32×32 by default and now set 16×16 themselves:

  • TerminalPage.cpp — new-tab dropdown, pane context menu, quick-fix menu
  • MainPage.cpp — profile nav entries

SearchIndex.cpp also had a // TODO GH #19806 comment 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

Before and After

Right-click pane context menu

Before and After 2

Settings → profile nav

Before and After 3

Profile page icon + left-nav updating after changing the icon

Before and After 4

New Tab Menu folder icon (newer feature than the current Store build — just showing the fork renders it at a sensible size)

Before and After 5 Before and After 6

Command palette

Before and After 7

Settings search (also newer than the Store release)

Before and After 8

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.

R-Alothaim and others added 3 commits April 15, 2026 00:32
…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.
@R-Alothaim
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@DHowett
Copy link
Copy Markdown
Member

DHowett commented Apr 17, 2026

Hmmm. We initially made IconWUX return 32x32 because the only place it was initially used was the New Tab menu; I would be wary of changing that specifically to 16x16. :)

@R-Alothaim
Copy link
Copy Markdown
Author

R-Alothaim commented Apr 17, 2026

Ah, didn't know that history, thanks. Pushed a commit keeping _CreateNewTabFlyoutIcon at 32×32. FYI the first screenshot shows the new-tab dropdown looking the same between the Store build (32×32) and that branch (16×16), but happy to defer to you.

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.

Refactor IconPathConverter::IconWUX() to not set icon size

2 participants