Scale panel fonts with VS's Environment Font size - #21
Open
DaveTseng2019 wants to merge 1 commit into
Open
Conversation
Replace hardcoded FontSize values in the panel and compose dialog with bindings relative to VsFonts.EnvironmentFontSizeKey, so text follows the user's Tools > Options > Environment > Fonts and Colors setting live instead of staying fixed regardless of DPI/accessibility preferences. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the extension’s WPF UI (the Claude panel and compose dialog) to scale text with Visual Studio’s Environment Font size (VsFonts.EnvironmentFontSizeKey) instead of using hardcoded font point values, so the UI tracks Tools > Options > Environment > Fonts and Colors live.
Changes:
- Added
FontScalehelper to bind a root element’sFontSizeto VS’s environment font size, and scale descendants by ratio. - Updated
ClaudeToolWindowControlto useFontScalefor headers, status lines, cards, feed, attachment chips, and buttons. - Updated
ComposeDialogto bind its root font size and scale the token estimate line relative to the root.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/ClaudeCodeVS/Ui/FontScale.cs | Introduces BindRoot (VS env font binding) and Bind (ratio scaling via ancestor binding) for code-built WPF UI. |
| src/ClaudeCodeVS/Ui/ComposeDialog.cs | Binds dialog font size to VS environment font and applies relative scaling for the estimate text. |
| src/ClaudeCodeVS/Ui/ClaudeToolWindowControl.cs | Replaces hardcoded FontSize usage with ratio-based scaling across panel UI elements (including buttons and log/feed lines). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Author
|
@firish 這個 PR 有空的話麻煩看一下,謝謝! |
Owner
|
@DaveTseng2019 Thanks for the PR. I'm traveling over the next few days, but will review, test, and merge as soon as I am back. |
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
VsFonts.EnvironmentFontSizeKey) instead of hardcoded point values, so it tracks Tools > Options > Environment > Fonts and Colors live.FontScale(BindRootfor the panel root,Bindfor descendants at a relative ratio) used throughoutClaudeToolWindowControlandComposeDialog.Test plan
FontFamilythan the rest of the panel — confirm it still scales with the same ratio and doesn't fall out of alignment with neighboring text🤖 Generated with Claude Code