-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from punker76/OnlyOneTemplateAndTheme
Move template and theme to core
- Loading branch information
Showing
9 changed files
with
96 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Styles xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | ||
<Styles.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<MergeResourceInclude Source="avares://IconPacks.Avalonia.Core/PackIconControlBase.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Styles.Resources> | ||
</Styles> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<ResourceDictionary xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:iconPacks="urn:iconpacks-avalonia" | ||
xmlns:converter="clr-namespace:IconPacks.Avalonia.Converter;assembly=IconPacks.Avalonia.Core" | ||
x:ClassModifier="internal"> | ||
|
||
<ControlTemplate x:Key="IconPacks.Avalonia.PackIconControlBase.Template" TargetType="iconPacks:PackIconControlBase"> | ||
<Grid> | ||
<Border Background="{TemplateBinding Background}" | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="{TemplateBinding BorderThickness}" /> | ||
<Grid x:Name="PART_InnerGrid" | ||
Margin="{TemplateBinding BorderThickness}"> | ||
<Viewbox x:Name="PART_ViewBox" | ||
Margin="{TemplateBinding Padding}"> | ||
<Path x:Name="PART_IconPath" | ||
Data="{Binding Data, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay, Converter={x:Static converter:NullToUnsetValueConverter.Instance}}" | ||
Stretch="Uniform" | ||
UseLayoutRounding="False" /> | ||
</Viewbox> | ||
</Grid> | ||
</Grid> | ||
</ControlTemplate> | ||
|
||
<ControlTheme x:Key="IconPacks.Avalonia.PackIconControlBase.Theme" TargetType="iconPacks:PackIconControlBase"> | ||
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundColor}" /> | ||
<Setter Property="Background" Value="Transparent" /> | ||
<Setter Property="Height" Value="{DynamicResource IconElementThemeHeight}" /> | ||
<Setter Property="Width" Value="{DynamicResource IconElementThemeWidth}" /> | ||
<Setter Property="IsTabStop" Value="False" /> | ||
<Setter Property="FlowDirection" Value="LeftToRight" /> | ||
<Setter Property="Padding" Value="0" /> | ||
<Setter Property="HorizontalAlignment" Value="Left" /> | ||
<Setter Property="VerticalAlignment" Value="Top" /> | ||
<Setter Property="UseLayoutRounding" Value="False" /> | ||
<Setter Property="Template" Value="{DynamicResource IconPacks.Avalonia.PackIconControlBase.Template}" /> | ||
|
||
<!-- icon is filled --> | ||
<Style Selector="^:icon-filled /template/ Path#PART_IconPath"> | ||
<Setter Property="Fill" Value="{Binding Foreground, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> | ||
</Style> | ||
|
||
<!-- icon is outlined --> | ||
<Style Selector="^:icon-outlined /template/ Path#PART_IconPath"> | ||
<Setter Property="Stroke" Value="{Binding Foreground, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> | ||
<Setter Property="StrokeThickness" Value="2" /> | ||
<Setter Property="StrokeLineCap" Value="Round" /> | ||
<Setter Property="StrokeJoin" Value="Round" /> | ||
<Setter Property="Width" Value="24" /> | ||
<Setter Property="Height" Value="24" /> | ||
</Style> | ||
|
||
<!-- flipped icon data --> | ||
<Style Selector="^:icon-data-flipped-vertically /template/ Viewbox#PART_ViewBox"> | ||
<Setter Property="RenderTransform" Value="scale(1, -1)" /> | ||
</Style> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="{x:Type iconPacks:PackIconControlBase}" | ||
BasedOn="{StaticResource IconPacks.Avalonia.PackIconControlBase.Theme}" | ||
TargetType="iconPacks:PackIconControlBase" /> | ||
|
||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.