Skip to content

Commit

Permalink
Merge pull request #244 from YJammak/main
Browse files Browse the repository at this point in the history
Fix Button FontFamily issue
  • Loading branch information
kikipoulet authored Jul 5, 2024
2 parents 9d87c4d + 310a657 commit 41cb4d1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions SukiUI/Theme/Button.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Setter Property="Background" Value="{DynamicResource SukiBackground}" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />

<Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}" />
<Setter Property="FontSize" Value="15" />
<Setter Property="Padding" Value="20,8" />
<Setter Property="Template">
Expand All @@ -36,7 +36,7 @@
<ContentPresenter HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
FontFamily="avares://SukiUI/CustomFont#Quicksand"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="DemiBold"
RecognizesAccessKey="True" />
Expand Down
30 changes: 16 additions & 14 deletions SukiUI/Theme/DropDownButton.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FontSize" Value="15" />
<Setter Property="Padding" Value="20,8" />
<Setter Property="FontWeight" Value="DemiBold"></Setter>
<Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}" />
<Setter Property="FontWeight" Value="DemiBold" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
Expand All @@ -21,7 +22,7 @@
CornerRadius="{TemplateBinding CornerRadius}">
<Border.Transitions>
<Transitions>
<BrushTransition Property="BorderBrush" Duration="0:0:0.25"></BrushTransition>
<BrushTransition Property="BorderBrush" Duration="0:0:0.25" />
</Transitions>
</Border.Transitions>
<Grid Name="InnerGrid">
Expand All @@ -32,35 +33,36 @@

<ContentPresenter Name="PART_ContentPresenter"
Grid.Column="0"
FontFamily="{StaticResource QuicksandFont}"
FontWeight="{TemplateBinding FontWeight}"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
RecognizesAccessKey="True" >
FontFamily="{TemplateBinding FontFamily}"
FontWeight="{TemplateBinding FontWeight}"
RecognizesAccessKey="True">
<ContentPresenter.Transitions>
<Transitions>
<BrushTransition Property="Foreground" Duration="0:0:0.25"></BrushTransition>
<BrushTransition Property="BorderBrush" Duration="0:0:0.25"></BrushTransition>
<BrushTransition Property="Foreground" Duration="0:0:0.25" />
<BrushTransition Property="BorderBrush" Duration="0:0:0.25" />
</Transitions>
</ContentPresenter.Transitions>
</ContentPresenter>

<PathIcon Grid.Column="1"
Width="12" Name="PART_Icon"
<PathIcon Name="PART_Icon"
Grid.Column="1"
Width="12"
Height="12"
Margin="0,0,10,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Data="{x:Static content:Icons.ChevronDown}"
Foreground="{DynamicResource SukiText}"
IsHitTestVisible="False"
UseLayoutRounding="False" >
UseLayoutRounding="False">
<PathIcon.Transitions>
<Transitions>
<BrushTransition Property="Foreground" Duration="0:0:0.25"></BrushTransition>
<BrushTransition Property="Foreground" Duration="0:0:0.25" />
</Transitions>
</PathIcon.Transitions>
</PathIcon>
Expand All @@ -71,8 +73,8 @@
</Setter.Value>
</Setter>



<Style Selector="^:pointerover">
<Style Selector="^ /template/ TextBlock">
<Setter Property="Foreground" Value="{DynamicResource SukiPrimaryColor}" />
Expand All @@ -84,7 +86,7 @@
<Style Selector="^ /template/ Border">
<Setter Property="BorderBrush" Value="{DynamicResource SukiPrimaryColor}" />
</Style>

<Style Selector="^ /template/ PathIcon#PART_Icon">
<Setter Property="Foreground" Value="{DynamicResource SukiPrimaryColor}" />
</Style>
Expand Down
2 changes: 1 addition & 1 deletion SukiUI/Theme/Index.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<system:TimeSpan x:Key="ShortAnimationDuration">0.2</system:TimeSpan>
<Easing x:Key="MenuEasing">CircularEaseOut</Easing>

<FontFamily x:Key="QuicksandFont">avares://SukiUI/CustomFont#Quicksand</FontFamily>
<FontFamily x:Key="DefaultFontFamily">avares://SukiUI/CustomFont#Quicksand</FontFamily>

<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://sukiUI/Theme/TextBlock.xaml" />
Expand Down
2 changes: 1 addition & 1 deletion SukiUI/Theme/TextBlock.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ControlTheme x:Key="SukiTextBlockStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="14" />
<Setter Property="FontFamily" Value="{StaticResource QuicksandFont}" />
<Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}" />

<Style Selector="^.h4">
<Setter Property="Margin" Value="0 7 0 10" />
Expand Down

0 comments on commit 41cb4d1

Please sign in to comment.