Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 0971918

Browse files
committed
Add design time resources for font scaling
Add scaling styles for built in Labels and TextBlocks on Visual Studio 2015 and up.
1 parent efd10b8 commit 0971918

File tree

4 files changed

+98
-0
lines changed

4 files changed

+98
-0
lines changed

src/GitHub.InlineReviews/Properties/DesignTimeResources.xaml

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/Dark/ThemedDialogColors.xaml" />
99
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/Dark/EnvironmentColors.xaml" />
1010
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/Dark/TreeViewColors.xaml" />
11+
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/FontScalingLabelStyle.xaml" />
12+
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/FontScalingTextBlockStyle.xaml" />
1113
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/CommonControlsButtonStyle.xaml" />
1214
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/CommonControlsCheckboxStyle.xaml" />
1315
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/CommonControlsComboboxStyle.xaml" />

src/GitHub.VisualStudio.UI/Properties/DesignTimeResources.xaml

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
<ResourceDictionary Source="/Themes/Dark/ThemedDialogColors.xaml" />
99
<ResourceDictionary Source="/Themes/Dark/EnvironmentColors.xaml" />
1010
<ResourceDictionary Source="/Themes/Dark/TreeViewColors.xaml" />
11+
<ResourceDictionary Source="/Themes/FontScalingLabelStyle.xaml" />
12+
<ResourceDictionary Source="/Themes/FontScalingTextBlockStyle.xaml" />
1113
<ResourceDictionary Source="/Themes/CommonControlsButtonStyle.xaml" />
1214
<ResourceDictionary Source="/Themes/CommonControlsCheckboxStyle.xaml" />
1315
<ResourceDictionary Source="/Themes/CommonControlsComboboxStyle.xaml" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<ResourceDictionary
2+
x:Uid="ResourceDictionary_1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.14.0">
5+
6+
<Style x:Uid="Style_1" TargetType="{x:Type Label}" x:Key="{x:Static vsfx:VsResourceKeys.LabelEnvironment375PercentFontSizeStyleKey}">
7+
<Setter x:Uid="Setter_1" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment375PercentFontSizeKey}}" />
8+
<Setter x:Uid="Setter_2" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment375PercentFontWeightKey}}" />
9+
<Setter x:Uid="Setter_3" Property="TextOptions.TextFormattingMode" Value="Ideal" />
10+
</Style>
11+
12+
<Style x:Uid="Style_2" TargetType="{x:Type Label}" x:Key="{x:Static vsfx:VsResourceKeys.LabelEnvironment310PercentFontSizeStyleKey}">
13+
<Setter x:Uid="Setter_4" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment310PercentFontSizeKey}}" />
14+
<Setter x:Uid="Setter_5" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment310PercentFontWeightKey}}" />
15+
<Setter x:Uid="Setter_6" Property="TextOptions.TextFormattingMode" Value="Ideal" />
16+
</Style>
17+
18+
<Style x:Uid="Style_11" TargetType="{x:Type Label}" x:Key="{x:Static vsfx:VsResourceKeys.LabelEnvironment200PercentFontSizeStyleKey}">
19+
<Setter x:Uid="Setter_30" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment200PercentFontSizeKey}}" />
20+
<Setter x:Uid="Setter_31" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment200PercentFontWeightKey}}" />
21+
<Setter x:Uid="Setter_32" Property="TextOptions.TextFormattingMode" Value="Ideal" />
22+
</Style>
23+
24+
<Style x:Uid="Style_4" TargetType="{x:Type Label}" x:Key="{x:Static vsfx:VsResourceKeys.LabelEnvironment155PercentFontSizeStyleKey}">
25+
<Setter x:Uid="Setter_10" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment155PercentFontSizeKey}}" />
26+
<Setter x:Uid="Setter_11" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment155PercentFontWeightKey}}" />
27+
<Setter x:Uid="Setter_12" Property="TextOptions.TextFormattingMode" Value="Ideal" />
28+
</Style>
29+
30+
<Style x:Uid="Style_5" TargetType="{x:Type Label}" x:Key="{x:Static vsfx:VsResourceKeys.LabelEnvironment133PercentFontSizeStyleKey}">
31+
<Setter x:Uid="Setter_13" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment133PercentFontSizeKey}}" />
32+
<Setter x:Uid="Setter_14" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment133PercentFontWeightKey}}" />
33+
<Setter x:Uid="Setter_15" Property="TextOptions.TextFormattingMode" Value="Ideal" />
34+
</Style>
35+
36+
<Style x:Uid="Style_6" TargetType="{x:Type Label}" x:Key="{x:Static vsfx:VsResourceKeys.LabelEnvironment122PercentFontSizeStyleKey}">
37+
<Setter x:Uid="Setter_16" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment122PercentFontSizeKey}}" />
38+
<Setter x:Uid="Setter_17" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment122PercentFontWeightKey}}" />
39+
<Setter x:Uid="Setter_18" Property="TextOptions.TextFormattingMode" Value="Ideal" />
40+
</Style>
41+
42+
<Style x:Uid="Style_8" TargetType="{x:Type Label}" x:Key="{x:Static vsfx:VsResourceKeys.LabelEnvironmentBoldStyleKey}">
43+
<Setter x:Uid="Setter_22" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.EnvironmentFontSizeKey}}" />
44+
<Setter x:Uid="Setter_23" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.EnvironmentBoldFontWeightKey}}" />
45+
</Style>
46+
47+
</ResourceDictionary>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<ResourceDictionary
2+
x:Uid="ResourceDictionary_1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.14.0">
5+
6+
<Style x:Uid="Style_1" TargetType="{x:Type TextBlock}" x:Key="{x:Static vsfx:VsResourceKeys.TextBlockEnvironment375PercentFontSizeStyleKey}">
7+
<Setter x:Uid="Setter_1" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment375PercentFontSizeKey}}" />
8+
<Setter x:Uid="Setter_2" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment375PercentFontWeightKey}}" />
9+
<Setter x:Uid="Setter_3" Property="TextOptions.TextFormattingMode" Value="Ideal" />
10+
</Style>
11+
12+
<Style x:Uid="Style_2" TargetType="{x:Type TextBlock}" x:Key="{x:Static vsfx:VsResourceKeys.TextBlockEnvironment310PercentFontSizeStyleKey}">
13+
<Setter x:Uid="Setter_4" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment310PercentFontSizeKey}}" />
14+
<Setter x:Uid="Setter_5" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment310PercentFontWeightKey}}" />
15+
<Setter x:Uid="Setter_6" Property="TextOptions.TextFormattingMode" Value="Ideal" />
16+
</Style>
17+
18+
<Style x:Uid="Style_11" TargetType="{x:Type TextBlock}" x:Key="{x:Static vsfx:VsResourceKeys.TextBlockEnvironment200PercentFontSizeStyleKey}">
19+
<Setter x:Uid="Setter_30" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment200PercentFontSizeKey}}" />
20+
<Setter x:Uid="Setter_31" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment200PercentFontWeightKey}}" />
21+
<Setter x:Uid="Setter_32" Property="TextOptions.TextFormattingMode" Value="Ideal" />
22+
</Style>
23+
24+
<Style x:Uid="Style_4" TargetType="{x:Type TextBlock}" x:Key="{x:Static vsfx:VsResourceKeys.TextBlockEnvironment155PercentFontSizeStyleKey}">
25+
<Setter x:Uid="Setter_10" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment155PercentFontSizeKey}}" />
26+
<Setter x:Uid="Setter_11" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment155PercentFontWeightKey}}" />
27+
<Setter x:Uid="Setter_12" Property="TextOptions.TextFormattingMode" Value="Ideal" />
28+
</Style>
29+
30+
<Style x:Uid="Style_5" TargetType="{x:Type TextBlock}" x:Key="{x:Static vsfx:VsResourceKeys.TextBlockEnvironment133PercentFontSizeStyleKey}">
31+
<Setter x:Uid="Setter_13" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment133PercentFontSizeKey}}" />
32+
<Setter x:Uid="Setter_14" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment133PercentFontWeightKey}}" />
33+
<Setter x:Uid="Setter_15" Property="TextOptions.TextFormattingMode" Value="Ideal" />
34+
</Style>
35+
36+
<Style x:Uid="Style_6" TargetType="{x:Type TextBlock}" x:Key="{x:Static vsfx:VsResourceKeys.TextBlockEnvironment122PercentFontSizeStyleKey}">
37+
<Setter x:Uid="Setter_16" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment122PercentFontSizeKey}}" />
38+
<Setter x:Uid="Setter_17" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.Environment122PercentFontWeightKey}}" />
39+
<Setter x:Uid="Setter_18" Property="TextOptions.TextFormattingMode" Value="Ideal" />
40+
</Style>
41+
42+
<Style x:Uid="Style_8" TargetType="{x:Type TextBlock}" x:Key="{x:Static vsfx:VsResourceKeys.TextBlockEnvironmentBoldStyleKey}">
43+
<Setter x:Uid="Setter_22" Property="FontSize" Value="{DynamicResource {x:Static vsfx:VsFonts.EnvironmentFontSizeKey}}" />
44+
<Setter x:Uid="Setter_23" Property="FontWeight" Value="{DynamicResource {x:Static vsfx:VsFonts.EnvironmentBoldFontWeightKey}}" />
45+
</Style>
46+
47+
</ResourceDictionary>

0 commit comments

Comments
 (0)