This repository has been archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add design time resources for font scaling
Add scaling styles for built in Labels and TextBlocks on Visual Studio 2015 and up.
- Loading branch information
Showing
4 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
47 changes: 47 additions & 0 deletions
47
src/GitHub.VisualStudio.UI/Themes/FontScalingLabelStyle.xaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<ResourceDictionary | ||
x:Uid="ResourceDictionary_1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.14.0"> | ||
|
||
<Style x:Uid="Style_1" TargetType="{x:Type Label}" x:Key="{x:Static vsfx:VsResourceKeys.LabelEnvironment375PercentFontSizeStyleKey}"> | ||
<Setter x:Uid="Setter_1" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment375PercentFontSizeKey}}" /> | ||
<Setter x:Uid="Setter_2" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment375PercentFontWeightKey}}" /> | ||
<Setter x:Uid="Setter_3" Property="TextOptions.TextFormattingMode" Value="Ideal" /> | ||
</Style> | ||
|
||
<Style x:Uid="Style_2" TargetType="{x:Type Label}" x:Key="{x:Static vsfx:VsResourceKeys.LabelEnvironment310PercentFontSizeStyleKey}"> | ||
<Setter x:Uid="Setter_4" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment310PercentFontSizeKey}}" /> | ||
<Setter x:Uid="Setter_5" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment310PercentFontWeightKey}}" /> | ||
<Setter x:Uid="Setter_6" Property="TextOptions.TextFormattingMode" Value="Ideal" /> | ||
</Style> | ||
|
||
<Style x:Uid="Style_11" TargetType="{x:Type Label}" x:Key="{x:Static vsfx:VsResourceKeys.LabelEnvironment200PercentFontSizeStyleKey}"> | ||
<Setter x:Uid="Setter_30" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment200PercentFontSizeKey}}" /> | ||
<Setter x:Uid="Setter_31" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment200PercentFontWeightKey}}" /> | ||
<Setter x:Uid="Setter_32" Property="TextOptions.TextFormattingMode" Value="Ideal" /> | ||
</Style> | ||
|
||
<Style x:Uid="Style_4" TargetType="{x:Type Label}" x:Key="{x:Static vsfx:VsResourceKeys.LabelEnvironment155PercentFontSizeStyleKey}"> | ||
<Setter x:Uid="Setter_10" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment155PercentFontSizeKey}}" /> | ||
<Setter x:Uid="Setter_11" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment155PercentFontWeightKey}}" /> | ||
<Setter x:Uid="Setter_12" Property="TextOptions.TextFormattingMode" Value="Ideal" /> | ||
</Style> | ||
|
||
<Style x:Uid="Style_5" TargetType="{x:Type Label}" x:Key="{x:Static vsfx:VsResourceKeys.LabelEnvironment133PercentFontSizeStyleKey}"> | ||
<Setter x:Uid="Setter_13" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment133PercentFontSizeKey}}" /> | ||
<Setter x:Uid="Setter_14" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment133PercentFontWeightKey}}" /> | ||
<Setter x:Uid="Setter_15" Property="TextOptions.TextFormattingMode" Value="Ideal" /> | ||
</Style> | ||
|
||
<Style x:Uid="Style_6" TargetType="{x:Type Label}" x:Key="{x:Static vsfx:VsResourceKeys.LabelEnvironment122PercentFontSizeStyleKey}"> | ||
<Setter x:Uid="Setter_16" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment122PercentFontSizeKey}}" /> | ||
<Setter x:Uid="Setter_17" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment122PercentFontWeightKey}}" /> | ||
<Setter x:Uid="Setter_18" Property="TextOptions.TextFormattingMode" Value="Ideal" /> | ||
</Style> | ||
|
||
<Style x:Uid="Style_8" TargetType="{x:Type Label}" x:Key="{x:Static vsfx:VsResourceKeys.LabelEnvironmentBoldStyleKey}"> | ||
<Setter x:Uid="Setter_22" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.EnvironmentFontSizeKey}}" /> | ||
<Setter x:Uid="Setter_23" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.EnvironmentBoldFontWeightKey}}" /> | ||
</Style> | ||
|
||
</ResourceDictionary> |
47 changes: 47 additions & 0 deletions
47
src/GitHub.VisualStudio.UI/Themes/FontScalingTextBlockStyle.xaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<ResourceDictionary | ||
x:Uid="ResourceDictionary_1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.14.0"> | ||
|
||
<Style x:Uid="Style_1" TargetType="{x:Type TextBlock}" x:Key="{x:Static vsfx:VsResourceKeys.TextBlockEnvironment375PercentFontSizeStyleKey}"> | ||
<Setter x:Uid="Setter_1" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment375PercentFontSizeKey}}" /> | ||
<Setter x:Uid="Setter_2" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment375PercentFontWeightKey}}" /> | ||
<Setter x:Uid="Setter_3" Property="TextOptions.TextFormattingMode" Value="Ideal" /> | ||
</Style> | ||
|
||
<Style x:Uid="Style_2" TargetType="{x:Type TextBlock}" x:Key="{x:Static vsfx:VsResourceKeys.TextBlockEnvironment310PercentFontSizeStyleKey}"> | ||
<Setter x:Uid="Setter_4" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment310PercentFontSizeKey}}" /> | ||
<Setter x:Uid="Setter_5" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment310PercentFontWeightKey}}" /> | ||
<Setter x:Uid="Setter_6" Property="TextOptions.TextFormattingMode" Value="Ideal" /> | ||
</Style> | ||
|
||
<Style x:Uid="Style_11" TargetType="{x:Type TextBlock}" x:Key="{x:Static vsfx:VsResourceKeys.TextBlockEnvironment200PercentFontSizeStyleKey}"> | ||
<Setter x:Uid="Setter_30" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment200PercentFontSizeKey}}" /> | ||
<Setter x:Uid="Setter_31" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment200PercentFontWeightKey}}" /> | ||
<Setter x:Uid="Setter_32" Property="TextOptions.TextFormattingMode" Value="Ideal" /> | ||
</Style> | ||
|
||
<Style x:Uid="Style_4" TargetType="{x:Type TextBlock}" x:Key="{x:Static vsfx:VsResourceKeys.TextBlockEnvironment155PercentFontSizeStyleKey}"> | ||
<Setter x:Uid="Setter_10" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment155PercentFontSizeKey}}" /> | ||
<Setter x:Uid="Setter_11" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment155PercentFontWeightKey}}" /> | ||
<Setter x:Uid="Setter_12" Property="TextOptions.TextFormattingMode" Value="Ideal" /> | ||
</Style> | ||
|
||
<Style x:Uid="Style_5" TargetType="{x:Type TextBlock}" x:Key="{x:Static vsfx:VsResourceKeys.TextBlockEnvironment133PercentFontSizeStyleKey}"> | ||
<Setter x:Uid="Setter_13" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment133PercentFontSizeKey}}" /> | ||
<Setter x:Uid="Setter_14" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment133PercentFontWeightKey}}" /> | ||
<Setter x:Uid="Setter_15" Property="TextOptions.TextFormattingMode" Value="Ideal" /> | ||
</Style> | ||
|
||
<Style x:Uid="Style_6" TargetType="{x:Type TextBlock}" x:Key="{x:Static vsfx:VsResourceKeys.TextBlockEnvironment122PercentFontSizeStyleKey}"> | ||
<Setter x:Uid="Setter_16" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment122PercentFontSizeKey}}" /> | ||
<Setter x:Uid="Setter_17" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment122PercentFontWeightKey}}" /> | ||
<Setter x:Uid="Setter_18" Property="TextOptions.TextFormattingMode" Value="Ideal" /> | ||
</Style> | ||
|
||
<Style x:Uid="Style_8" TargetType="{x:Type TextBlock}" x:Key="{x:Static vsfx:VsResourceKeys.TextBlockEnvironmentBoldStyleKey}"> | ||
<Setter x:Uid="Setter_22" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.EnvironmentFontSizeKey}}" /> | ||
<Setter x:Uid="Setter_23" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.EnvironmentBoldFontWeightKey}}" /> | ||
</Style> | ||
|
||
</ResourceDictionary> |