Panel layout: scale fonts with VS's Environment Font, drop the duplicate title, wrap the toolbar - #25
Open
DaveTseng2019 wants to merge 2 commits into
Open
Panel layout: scale fonts with VS's Environment Font, drop the duplicate title, wrap the toolbar#25DaveTseng2019 wants to merge 2 commits into
DaveTseng2019 wants to merge 2 commits into
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>
The tool window's own Caption already shows "Claude Code" in the tab, so the panel's own header duplicated it. The Launch/External console buttons also got clipped instead of wrapping when the panel was docked narrower than they fit, unlike the checkbox row below them. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR improves the Visual Studio tool window panel’s layout and typography so it integrates better with the host IDE’s look-and-feel. It introduces a small WPF helper that derives all panel font sizes from VS’s Environment Font size, removes redundant in-panel title rendering, and updates the toolbar layout so controls remain accessible at narrow widths.
Changes:
- Added
Ui/FontScale.csto bind a panel root toVsFonts.EnvironmentFontSizeKeyand scale descendant elements by ratio. - Updated
ComposeDialogandClaudeToolWindowControlto useFontScaleinstead of hardcodedFontSizevalues. - Removed the duplicate “Claude Code” header line and replaced the toolbar
DockPanelwith aWrapPanelto avoid button clipping.
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 | New helper for binding UI font sizes to VS Environment Font size and scaling descendants proportionally. |
| src/ClaudeCodeVS/Ui/ComposeDialog.cs | Binds dialog font sizing to VS Environment Font and replaces hardcoded font sizes with scaled ratios. |
| src/ClaudeCodeVS/Ui/ClaudeToolWindowControl.cs | Removes redundant title, converts toolbar to wrapping layout, and replaces hardcoded font sizes with scaled ratios across the panel. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Re-submission of the panel-layout half of the now-closed #21 and #24, split out so each PR is one reviewable topic.
What
1. Fonts follow VS's Environment Font size (
Ui/FontScale.cs)The panel hard-coded pixel sizes, so it ignored Tools > Options > Environment > Fonts and Colors and stayed tiny (or huge) whenever the user had scaled the IDE. Every panel font is now derived from the shell's Environment Font, and
ComposeDialogfollows the same scale.2. Duplicate panel title removed
The tool window frame already renders "Claude Code" in its tab; the control drew a second copy right below it. Removed the redundant one.
3. Toolbar wraps instead of clipping
The toolbar was a
DockPanelwith Clear/Output docked right, which pre-claims width and clipped the Launch buttons mid-text at narrow panel widths. It is now one flatWrapPanel- every button stays whole and reachable at any width. Right-alignment wasn't worth losing the buttons.Notes
🤖 Generated with Claude Code