Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/ColorPicker.AvaloniaUI/Behaviors/TextBoxFocusBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,17 @@ private void AssociatedObject_KeyUp(object sender, KeyEventArgs e)

private void RemoveFocus()
{
var focusManager = TopLevel.GetTopLevel(AssociatedObject).FocusManager;
var focusManager = TopLevel.GetTopLevel(AssociatedObject)?.FocusManager;
if (focusManager == null) return;

var current = focusManager.GetFocusedElement();
if (current != null)
{
//TODO: Find non obsolete way to do this
var next = KeyboardNavigationHandler.GetNext(AssociatedObject, NavigationDirection.Next);
next?.Focus(NavigationMethod.Tab);
focusManager.TryMoveFocus(NavigationDirection.Next);
}
}

private void AssociatedObjectGotKeyboardFocus(
object sender, GotFocusEventArgs e)
private void AssociatedObjectGotKeyboardFocus(object sender, FocusChangedEventArgs e)
{
if (SelectOnMouseClick || e.NavigationMethod == NavigationMethod.Tab)
{
Expand Down
18 changes: 3 additions & 15 deletions src/ColorPicker.AvaloniaUI/ColorPicker.AvaloniaUI.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net10.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down Expand Up @@ -31,8 +31,8 @@ Originally developed for PixiEditor: https://github.com/PixiEditor/PixiEditor.</
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.3.12-cibuild0004211-alpha" />
<PackageReference Include="Xaml.Behaviors" Version="11.3.6.5" />
<PackageReference Include="Avalonia" Version="12.1.1-cibuild0004440-alpha" />
<PackageReference Include="Xaml.Behaviors" Version="12.0.5" />
</ItemGroup>

<ItemGroup>
Expand All @@ -44,12 +44,6 @@ Originally developed for PixiEditor: https://github.com/PixiEditor/PixiEditor.</
<AvaloniaResource Include="Images\**" />
</ItemGroup>

<ItemGroup>
<Compile Update="Templates\SimpleColorPickerTheme.axaml.cs">
<DependentUpon>ColorPickerTheme.axaml</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<None Include="..\..\LICENSE.md">
<Pack>True</Pack>
Expand All @@ -70,10 +64,4 @@ Originally developed for PixiEditor: https://github.com/PixiEditor/PixiEditor.</
<PackagePath></PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<Reference Include="Avalonia.Base">
<HintPath>..\..\..\..\.nuget\packages\avalonia\11.0.5\ref\net6.0\Avalonia.Base.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
3 changes: 1 addition & 2 deletions src/ColorPicker.AvaloniaUI/Templates/GradientBar.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:colorPicker="clr-namespace:ColorPicker"
xmlns:converters="clr-namespace:ColorPicker.Converters"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:models="clr-namespace:ColorPicker.Models;assembly=ColorPicker.Models">
<ControlTheme TargetType="colorPicker:GradientBar" x:Key="{x:Type colorPicker:GradientBar}">
<ControlTheme.Resources>
Expand Down Expand Up @@ -49,7 +48,7 @@
<ControlTheme TargetType="ContentPresenter">
<Setter Property="Margin">
<MultiBinding Converter="{StaticResource OffsetToMarginConverter}">
<Binding Path="Offset" />
<Binding Path="Offset" RelativeSource="{RelativeSource AncestorType=GradientStop}" />
<Binding Path="Bounds.Width"
RelativeSource="{RelativeSource AncestorType=ItemsControl}" />
</MultiBinding>
Expand Down
2 changes: 1 addition & 1 deletion src/ColorPicker.AvaloniaUI/Templates/HueSlider.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Image Source="/Images/CircularHueGradient.png" Stretch="Fill"
IsHitTestVisible="False">
<Image.OpacityMask>
<RadialGradientBrush GradientOrigin="50%,50%" Center="50%, 50%" Radius="0.5">
<RadialGradientBrush GradientOrigin="50%,50%" Center="50%, 50%" RadiusX="0.5" RadiusY="0.5">
<RadialGradientBrush.GradientStops>
<GradientStop Color="Transparent" Offset="0" />
<GradientStop Color="Transparent" Offset="0.839" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<ComboBoxItem localization:Translator.Key="COLOR_PICKER_GRADIENT_RADIAL" />
<ComboBoxItem localization:Translator.Key="COLOR_PICKER_GRADIENT_CONICAL" />
</ComboBox>
<colorPicker:GradientBar Name="GradientBar"
<colorPicker:GradientBar x:Name="GradientBar"
GradientStops="{Binding GradientBrush.GradientStops, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
GradientState="{Binding GradientState, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />

Expand Down Expand Up @@ -120,7 +120,7 @@
StartPointY="{Binding NotifyableGradient.LinearStartPointY, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
EndPointX="{Binding NotifyableGradient.LinearEndPointX, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
EndPointY="{Binding NotifyableGradient.LinearEndPointY, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
StartGradientStop="{Binding GradientBrush.GradientStops[0], RelativeSource={RelativeSource TemplatedParent}}"
StartGradientStop="{ReflectionBinding GradientBrush.GradientStops[0], RelativeSource={RelativeSource TemplatedParent}}"
EndGradientStop="{Binding GradientBrush.GradientStops, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource LastItemOfConverter}}" />
<Grid HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
Expand Down
2 changes: 1 addition & 1 deletion src/ColorPicker.Models/ColorPicker.Models.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>ColorPicker.Models</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>PixiEditor.ColorPicker.Models</PackageId>
Expand Down