mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-15 21:56:36 +08:00
feat: colorpicker reference Shared package.
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converters="using:Avalonia.Controls.Converters">
|
xmlns:iri="https://irihi.tech/shared"
|
||||||
<converters:CornerRadiusFilterConverter x:Key="LeftCornerRadiusFilterConverter" Filter="TopLeft, BottomLeft" />
|
xmlns:converters="using:Avalonia.Controls.Converters"
|
||||||
|
x:CompileBindings="True">
|
||||||
<converters:ToBrushConverter x:Key="ToBrushConverter" />
|
<converters:ToBrushConverter x:Key="ToBrushConverter" />
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type ColorPicker}" TargetType="ColorPicker">
|
<ControlTheme x:Key="{x:Type ColorPicker}" TargetType="ColorPicker">
|
||||||
@@ -16,11 +17,11 @@
|
|||||||
<Border
|
<Border
|
||||||
Margin="1,1,0,1"
|
Margin="1,1,0,1"
|
||||||
Background="{DynamicResource ColorControlCheckeredBackgroundBrush}"
|
Background="{DynamicResource ColorControlCheckeredBackgroundBrush}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius, Converter={StaticResource LeftCornerRadiusFilterConverter}}" />
|
CornerRadius="{TemplateBinding CornerRadius, Converter={iri:CornerRadiusMixerConverter Left}}" />
|
||||||
<Border
|
<Border
|
||||||
Margin="1,1,0,1"
|
Margin="1,1,0,1"
|
||||||
Background="{TemplateBinding HsvColor, Converter={StaticResource ToBrushConverter}}"
|
Background="{TemplateBinding HsvColor, Converter={StaticResource ToBrushConverter}}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius, Converter={StaticResource LeftCornerRadiusFilterConverter}}" />
|
CornerRadius="{TemplateBinding CornerRadius, Converter={iri:CornerRadiusMixerConverter Left}}" />
|
||||||
</Panel>
|
</Panel>
|
||||||
</Template>
|
</Template>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converters="using:Avalonia.Controls.Converters"
|
xmlns:iri="https://irihi.tech/shared"
|
||||||
xmlns:pc="using:Avalonia.Controls.Primitives.Converters">
|
xmlns:pc="using:Avalonia.Controls.Primitives.Converters"
|
||||||
|
x:CompileBindings="True">
|
||||||
<pc:AccentColorConverter x:Key="AccentColorConverter" />
|
<pc:AccentColorConverter x:Key="AccentColorConverter" />
|
||||||
<converters:CornerRadiusFilterConverter x:Key="LeftCornerRadiusFilterConverter" Filter="TopLeft, BottomLeft" />
|
|
||||||
<converters:CornerRadiusFilterConverter x:Key="RightCornerRadiusFilterConverter" Filter="TopRight, BottomRight" />
|
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type ColorPreviewer}" TargetType="ColorPreviewer">
|
<ControlTheme x:Key="{x:Type ColorPreviewer}" TargetType="ColorPreviewer">
|
||||||
<Setter Property="Height" Value="{DynamicResource ColorPreviewerHeight}" />
|
<Setter Property="Height" Value="{DynamicResource ColorPreviewerHeight}" />
|
||||||
@@ -34,7 +33,7 @@
|
|||||||
Background="{TemplateBinding HsvColor,
|
Background="{TemplateBinding HsvColor,
|
||||||
Converter={StaticResource AccentColorConverter},
|
Converter={StaticResource AccentColorConverter},
|
||||||
ConverterParameter='-2'}"
|
ConverterParameter='-2'}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius,Converter={StaticResource LeftCornerRadiusFilterConverter}}"
|
CornerRadius="{TemplateBinding CornerRadius,Converter={iri:CornerRadiusMixerConverter Left}}"
|
||||||
Tag="-2" />
|
Tag="-2" />
|
||||||
<Border
|
<Border
|
||||||
Name="PART_AccentDecrement1Border"
|
Name="PART_AccentDecrement1Border"
|
||||||
@@ -70,7 +69,7 @@
|
|||||||
Background="{TemplateBinding HsvColor,
|
Background="{TemplateBinding HsvColor,
|
||||||
Converter={StaticResource AccentColorConverter},
|
Converter={StaticResource AccentColorConverter},
|
||||||
ConverterParameter='2'}"
|
ConverterParameter='2'}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius,Converter={StaticResource RightCornerRadiusFilterConverter}}"
|
CornerRadius="{TemplateBinding CornerRadius,Converter={iri:CornerRadiusMixerConverter Right}}"
|
||||||
Tag="2" />
|
Tag="2" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<!-- Preview color: Must be last for drop shadow Z-index -->
|
<!-- Preview color: Must be last for drop shadow Z-index -->
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Irihi.Avalonia.Shared" />
|
||||||
<PackageReference Include="Avalonia.Controls.ColorPicker"/>
|
<PackageReference Include="Avalonia.Controls.ColorPicker"/>
|
||||||
<None Include="README.md" Pack="true" PackagePath="\"/>
|
<None Include="README.md" Pack="true" PackagePath="\"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user