Skip to content

Commit 2d1e9ec

Browse files
committed
Add ContentControlThemeFontFamily to support dynamic font styling
1 parent 02252c2 commit 2d1e9ec

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Flow.Launcher/App.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ await API.StopwatchLogInfoAsync(ClassName, "Startup cost", async () =>
177177

178178
_mainWindow = new MainWindow();
179179
Current.Resources["SettingWindowFont"] = new FontFamily(_settings.SettingWindowFont);
180+
Current.Resources["ContentControlThemeFontFamily"] = new FontFamily(_settings.SettingWindowFont);
180181

181182
API.LogInfo(ClassName, "Dependencies Info:{ErrorReporting.DependenciesInfo()}");
182183

Flow.Launcher/Resources/CustomControlTemplate.xaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<Style TargetType="Window">
1919
<Setter Property="FontFamily" Value="{DynamicResource SettingWindowFont}" />
2020
</Style>
21+
<FontFamily x:Key="ContentControlThemeFontFamily">
22+
{DynamicResource SettingWindowFont}
23+
</FontFamily>
2124

2225
<ContextMenu x:Key="TextBoxContextMenu">
2326
<MenuItem Command="ApplicationCommands.Cut" Header="{DynamicResource cut}">
@@ -1360,7 +1363,6 @@
13601363
<Setter Property="SelectionBrush" Value="{DynamicResource TextControlSelectionHighlightColor}" />
13611364
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
13621365
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
1363-
<Setter Property="FontFamily" Value="{DynamicResource SettingWindowFont}" />
13641366
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
13651367
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
13661368
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
@@ -1584,6 +1586,7 @@
15841586

15851587
<Style BasedOn="{StaticResource DefaultPasswordBoxStyle}" TargetType="PasswordBox">
15861588
<Setter Property="ContextMenu" Value="{StaticResource TextBoxContextMenu}" />
1589+
<Setter Property="FontFamily" Value="{DynamicResource SettingWindowFont}" />
15871590
</Style>
15881591

15891592
<Style
@@ -2744,6 +2747,7 @@
27442747
Margin="{TemplateBinding BorderThickness}"
27452748
Padding="{TemplateBinding Padding}"
27462749
Focusable="False"
2750+
FontFamily="{DynamicResource ContentControlThemeFontFamily}"
27472751
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
27482752
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
27492753
IsTabStop="False"
@@ -2756,6 +2760,7 @@
27562760
Grid.ColumnSpan="2"
27572761
Margin="{TemplateBinding BorderThickness}"
27582762
Padding="{TemplateBinding Padding}"
2763+
FontFamily="{DynamicResource ContentControlThemeFontFamily}"
27592764
Foreground="{TemplateBinding ui:ControlHelper.PlaceholderForeground}"
27602765
IsHitTestVisible="False"
27612766
Text="{TemplateBinding ui:ControlHelper.PlaceholderText}"

0 commit comments

Comments
 (0)