Add ContentControlThemeFontFamily to support dynamic font styling

This commit is contained in:
DB p 2025-04-24 19:06:24 +09:00
parent 02252c2181
commit 2d1e9ecd3b
2 changed files with 7 additions and 1 deletions

View file

@ -177,6 +177,7 @@ namespace Flow.Launcher
_mainWindow = new MainWindow();
Current.Resources["SettingWindowFont"] = new FontFamily(_settings.SettingWindowFont);
Current.Resources["ContentControlThemeFontFamily"] = new FontFamily(_settings.SettingWindowFont);
API.LogInfo(ClassName, "Dependencies Info:{ErrorReporting.DependenciesInfo()}");

View file

@ -18,6 +18,9 @@
<Style TargetType="Window">
<Setter Property="FontFamily" Value="{DynamicResource SettingWindowFont}" />
</Style>
<FontFamily x:Key="ContentControlThemeFontFamily">
{DynamicResource SettingWindowFont}
</FontFamily>
<ContextMenu x:Key="TextBoxContextMenu">
<MenuItem Command="ApplicationCommands.Cut" Header="{DynamicResource cut}">
@ -1360,7 +1363,6 @@
<Setter Property="SelectionBrush" Value="{DynamicResource TextControlSelectionHighlightColor}" />
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
<Setter Property="FontFamily" Value="{DynamicResource SettingWindowFont}" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
@ -1584,6 +1586,7 @@
<Style BasedOn="{StaticResource DefaultPasswordBoxStyle}" TargetType="PasswordBox">
<Setter Property="ContextMenu" Value="{StaticResource TextBoxContextMenu}" />
<Setter Property="FontFamily" Value="{DynamicResource SettingWindowFont}" />
</Style>
<Style
@ -2744,6 +2747,7 @@
Margin="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
Focusable="False"
FontFamily="{DynamicResource ContentControlThemeFontFamily}"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
IsTabStop="False"
@ -2756,6 +2760,7 @@
Grid.ColumnSpan="2"
Margin="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
FontFamily="{DynamicResource ContentControlThemeFontFamily}"
Foreground="{TemplateBinding ui:ControlHelper.PlaceholderForeground}"
IsHitTestVisible="False"
Text="{TemplateBinding ui:ControlHelper.PlaceholderText}"