Skip to content

Commit

Permalink
Made Font Names Dynamic (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
dipeshmsft authored Apr 17, 2024
1 parent 93a09dd commit 78a9f06
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.FluentWindows;component/Resources/DefaultFocusVisualStyle.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.FluentWindows;component/Resources/StaticColors.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.FluentWindows;component/Resources/Variables.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.FluentWindows;component/Resources/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.FluentWindows;component/Styles/Button.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.FluentWindows;component/Styles/Calendar.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.FluentWindows;component/Styles/CheckBox.xaml" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!--
This Source Code Form is subject to the terms of the MIT License.
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
All Rights Reserved.
Based on Microsoft XAML for Win UI
Copyright (c) Microsoft Corporation. All Rights Reserved.
-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<FontFamily x:Key="SegoeFluentIcons">Segoe Fluent Icons</FontFamily>

This comment has been minimized.

Copy link
@batzen

batzen Apr 17, 2024

Contributor

The name already contains it's value. Wouldn't something like "IconFont" be a better name?

</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
<Button.Content>
<TextBlock
FontSize="8"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
>&#xEDDB;</TextBlock>
</Button.Content>
</Button>
Expand All @@ -373,7 +373,7 @@
<Button.Content>
<TextBlock
FontSize="8"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
>&#xEDDC;</TextBlock>
</Button.Content>
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
FontSize="{StaticResource CheckBoxIconSize}"
FontWeight="Bold"
Foreground="{DynamicResource CheckBoxCheckGlyphForeground}"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
Visibility="Collapsed"
Text="{StaticResource CheckBoxCheckedGlyph}" />
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
FontSize="{StaticResource ComboBoxChevronSize}"
Foreground="{DynamicResource ComboBoxDropDownGlyphForeground}"
RenderTransformOrigin="0.5, 0.5"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
Text ="{StaticResource ComboBoxChevronDownGlyph}">
<TextBlock.RenderTransform>
<RotateTransform Angle="0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@
VerticalAlignment="Center"
FontSize="12"
Opacity="0"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
Text="&#xE8CB;" />
</Grid>
<VisualStateManager.VisualStateGroups>
Expand Down Expand Up @@ -683,7 +683,7 @@
VerticalAlignment="Center"
FontSize="{StaticResource CheckBoxIconSize}"
FontWeight="Bold"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
Text="{StaticResource CheckBoxCheckedGlyph}"
Visibility="Collapsed">
<TextBlock.Foreground>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
Margin="{StaticResource DatePickerCalendarButtonPadding}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
FontSize="{StaticResource DatePickerCalendarButtonIconSize}"
Foreground="{TemplateBinding Foreground}"
Text="{StaticResource CalendarGlyph}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
x:Name="ControlChevronIcon"
FontSize="{StaticResource ExpanderChevronSize}"
Foreground="{TemplateBinding Foreground}"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
HorizontalAlignment="Center"
Text="{StaticResource ExpanderChevronDownGlyph}" />
</Grid>
Expand Down Expand Up @@ -111,7 +111,7 @@
x:Name="ControlChevronIcon"
FontSize="{StaticResource ExpanderChevronSize}"
Foreground="{TemplateBinding Foreground}"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
HorizontalAlignment="Center"
Text="{StaticResource ExpanderChevronUpGlyph}" />
</Grid>
Expand Down Expand Up @@ -171,7 +171,7 @@
x:Name="ControlChevronIcon"
FontSize="{StaticResource ExpanderChevronSize}"
Foreground="{TemplateBinding Foreground}"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
HorizontalAlignment="Center"
Text="{StaticResource ExpanderChevronLeftGlyph}" />
</Grid>
Expand Down Expand Up @@ -231,7 +231,7 @@
x:Name="ControlChevronIcon"
FontSize="{StaticResource ExpanderChevronSize}"
Foreground="{TemplateBinding Foreground}"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
HorizontalAlignment="Center"
Text="{StaticResource ExpanderChevronRightGlyph}" />
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
x:Name="CheckBoxIcon"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
FontSize="16"
Text=""
TextAlignment="Center" />
Expand Down Expand Up @@ -326,7 +326,7 @@
x:Name="Chevron"
Margin="0,3,0,0"
VerticalAlignment="Center"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
FontSize="{TemplateBinding FontSize}"
Text="{StaticResource MenuItemChevronRightGlyph}" />
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
VerticalAlignment="Center"
FontSize="{TemplateBinding FontSize}"
Foreground="{TemplateBinding Foreground}"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
Text="{Binding Path=Content, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" />
</Border>
<ControlTemplate.Triggers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
<Button.Content>
<TextBlock
FontSize="{TemplateBinding FontSize}"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
>&#xE894;</TextBlock>
</Button.Content>
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
Margin="0"
VerticalAlignment="Bottom"
Foreground="{TemplateBinding Foreground}"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
Text="{StaticResource ToolBarChevronDownGlyph}" />
<ContentPresenter />
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
x:Name="ChevronIcon"
VerticalAlignment="Center"
FontSize="{StaticResource TreeViewItemChevronSize}"
FontFamily="Segoe Fluent Icons"
FontFamily="{DynamicResource SegoeFluentIcons}"
HorizontalAlignment="Center"
Text="{StaticResource TreeViewChevronRightGlyph}" />
</Grid>
Expand Down

0 comments on commit 78a9f06

Please sign in to comment.