Skip to content

Settings: Fix settings arrow render#46454

Open
vanzue wants to merge 7 commits intomainfrom
dev/vanzue/fix-up-down-arrow-render
Open

Settings: Fix settings arrow render#46454
vanzue wants to merge 7 commits intomainfrom
dev/vanzue/fix-up-down-arrow-render

Conversation

@vanzue
Copy link
Contributor

@vanzue vanzue commented Mar 24, 2026

Summary of the Pull Request

Existing:
image

A box icon for whatever up, down, left, right, they are not treated as Glyph icon rendered, instead as normal text

PR Checklist

  • Closes: #xxx
  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

image

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the shared KeyVisual control used across PowerToys UI to correctly render arrow keys (Up/Down/Left/Right) in Settings by switching from private-use glyph codepoints (which were rendering as “box” placeholders) to standard Unicode arrow characters.

Changes:

  • Call Update() when Content/RenderKeyAsGlyph changes so the presenter content/style is refreshed immediately.
  • Add a null-guard in Update() to avoid work (and potential issues) before the template child is available.
  • Replace the arrow key “glyph” codepoints with ↑/↓/←/→ Unicode characters for reliable rendering.

@vanzue vanzue marked this pull request as ready for review March 24, 2026 02:08
@vanzue vanzue added the 0.98.1 label Mar 24, 2026
@vanzue
Copy link
Contributor Author

vanzue commented Mar 24, 2026

Coding change is minimal, I think it's safe for 0.98.1? Although it's not regression

@vanzue
Copy link
Contributor Author

vanzue commented Mar 24, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines +143 to +156
case VirtualKey.Up:
_keyPresenter.Content = "\uE0E4";
SetGlyph("\uE0E4");
break;

case VirtualKey.Down:
_keyPresenter.Content = "\uE0E5";
SetGlyph("\uE0E5");
break;

case VirtualKey.Left:
_keyPresenter.Content = "\uE0E2";
SetGlyph("\uE0E2");
break;

case VirtualKey.Right:
_keyPresenter.Content = "\uE0E3";
SetGlyph("\uE0E3");
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

The arrow key cases now call SetGlyph(...) directly, which bypasses the RenderKeyAsGlyph behavior that SetGlyphOrText(...) provides for Enter/Back/Shift. To keep the control’s API consistent (and allow RenderKeyAsGlyph=false to render arrows as text like "Up"/"Down"), route the arrow cases through SetGlyphOrText(glyph, virtualKey) instead of calling SetGlyph unconditionally.

Copilot uses AI. Check for mistakes.

case VirtualKey.Up:
_keyPresenter.Content = "\uE0E4";
SetGlyph("\uE0E4");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use SetGlyphOrText? or refactor it because it's doing partially the same thing as this new method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I did not realize we have this, right, we should make this cleaner

@vanzue vanzue removed the 0.98.1 label Mar 24, 2026
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