Skip to content

Bind to EnvironmentFontFamily in DocumentOutLineWindow.#68811

Merged
Cosifne merged 2 commits intodotnet:mainfrom
Cosifne:dev/shech/UpdateFontForDocumentOutlineWindow
Jun 30, 2023
Merged

Bind to EnvironmentFontFamily in DocumentOutLineWindow.#68811
Cosifne merged 2 commits intodotnet:mainfrom
Cosifne:dev/shech/UpdateFontForDocumentOutlineWindow

Conversation

@Cosifne
Copy link
Copy Markdown
Member

@Cosifne Cosifne commented Jun 28, 2023

Fix #68809
It is needed because we need the ability to display GB18030.
In order to display it, OullineWindow must be able to change the font, since not all the font supports the character set.
After the change, all the character can be displayed:
image

Several problems in the existing code.

  1. Currently DocumentOutlineWindow is wrapped in a Windows form control in order to get the handle and send it back to shell.
    I don't know a lot about WinForm but it doesn't inherit the property from the parent like in WPF.
    Like:
    The child font doesn't match its parent font
image image In this case, all the elements (except the one with font-family property) in the window would inherit from the windows form control. And I don't find there is a way to change this.
  1. We only set Font for TreeView and TextBox now. This feels wrong since the tool window might have SearchTextBox.

  2. The Font used is vsshell:VsFonts.CaptionFontFamilyKey, I don't know what it means in the shell. But from what I understand here, this is the font used in VS title bar. I don't feel it is meaningful to keep the font here the same as the Title bar.

@Cosifne Cosifne requested a review from a team as a code owner June 28, 2023 07:24
@ghost ghost added Needs UX Triage Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 28, 2023
@sharwell
Copy link
Copy Markdown
Contributor

sharwell commented Jun 28, 2023

We only set Font for TreeView and TextBox now. This feels wrong since the tool window might have SearchTextBox.

The search box is a platform control, not implemented or provided by us. This change was implemented in #68094.

@Cosifne
Copy link
Copy Markdown
Member Author

Cosifne commented Jun 28, 2023

We only set Font for TreeView and TextBox now. This feels wrong since the tool window might have SearchTextBox.

The search box is a platform control, not implemented or provided by us. This change was implemented in #68094.

What I mean is we need to have a way to change the text font in the search text box.
From there we just make sure all the TreeView and TextBox would have the correct font.
If we specify the font at DocumentViewOutline control level, all the child element of it would inherited the property (if it is not specified), which solves our problem.

@Cosifne Cosifne requested review from ryzngard and sharwell June 28, 2023 18:41
@Cosifne
Copy link
Copy Markdown
Member Author

Cosifne commented Jun 28, 2023

Also tag Andrew to review @ryzngard

@Cosifne Cosifne merged commit f290437 into dotnet:main Jun 30, 2023
@Cosifne Cosifne deleted the dev/shech/UpdateFontForDocumentOutlineWindow branch June 30, 2023 17:22
@ghost ghost added this to the Next milestone Jun 30, 2023
@allisonchou allisonchou modified the milestones: Next, 17.8 P1 Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Needs UX Triage untriaged Issues and PRs which have not yet been triaged by a lead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Text font in DocumentOutline can't be changed

3 participants