Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
PieroCastillo committed Feb 4, 2022
1 parent e9ae438 commit 2eea7c0
Show file tree
Hide file tree
Showing 23 changed files with 218 additions and 160 deletions.
31 changes: 29 additions & 2 deletions Aura.UI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aura.UI.Gallery.NetCore", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aura.UI.Gallery.Web", "samples\Aura.UI.Gallery.Web\Aura.UI.Gallery.Web.csproj", "{E7ADBCED-FBED-4C95-B185-8002277B6690}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aura.UI.Painting", "src\Aura.UI.Painting\Aura.UI.Painting.csproj", "{1B62A10F-0645-4F86-B772-5B07F73A8A57}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aura.UI.Painting", "src\Aura.UI.Painting\Aura.UI.Painting.csproj", "{1B62A10F-0645-4F86-B772-5B07F73A8A57}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aura.UI.Painting.FluentTheme", "src\Aura.UI.Painting.FluentTheme\Aura.UI.Painting.FluentTheme.csproj", "{E0A75E75-CB4A-4E77-B311-E8D7CEC23D21}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aura.UI.Painting.FluentTheme", "src\Aura.UI.Painting.FluentTheme\Aura.UI.Painting.FluentTheme.csproj", "{E0A75E75-CB4A-4E77-B311-E8D7CEC23D21}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aura.UI.Neumorphism", "src\Aura.UI.Neumorphism\Aura.UI.Neumorphism.csproj", "{C475616B-704D-4A67-8E4C-A5D39D975B15}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -329,6 +331,30 @@ Global
{E0A75E75-CB4A-4E77-B311-E8D7CEC23D21}.Release|x64.Build.0 = Release|Any CPU
{E0A75E75-CB4A-4E77-B311-E8D7CEC23D21}.Release|x86.ActiveCfg = Release|Any CPU
{E0A75E75-CB4A-4E77-B311-E8D7CEC23D21}.Release|x86.Build.0 = Release|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Debug|ARM.ActiveCfg = Debug|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Debug|ARM.Build.0 = Debug|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Debug|iPhone.Build.0 = Debug|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Debug|x64.ActiveCfg = Debug|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Debug|x64.Build.0 = Debug|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Debug|x86.ActiveCfg = Debug|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Debug|x86.Build.0 = Debug|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Release|Any CPU.Build.0 = Release|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Release|ARM.ActiveCfg = Release|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Release|ARM.Build.0 = Release|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Release|iPhone.ActiveCfg = Release|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Release|iPhone.Build.0 = Release|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Release|x64.ActiveCfg = Release|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Release|x64.Build.0 = Release|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Release|x86.ActiveCfg = Release|Any CPU
{C475616B-704D-4A67-8E4C-A5D39D975B15}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -345,6 +371,7 @@ Global
{E7ADBCED-FBED-4C95-B185-8002277B6690} = {3AF1E581-2ACF-4F42-BC10-12BACF221499}
{1B62A10F-0645-4F86-B772-5B07F73A8A57} = {E0772EFF-1A2A-466C-83C7-A81D93213336}
{E0A75E75-CB4A-4E77-B311-E8D7CEC23D21} = {E0772EFF-1A2A-466C-83C7-A81D93213336}
{C475616B-704D-4A67-8E4C-A5D39D975B15} = {E0772EFF-1A2A-466C-83C7-A81D93213336}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B04BDC4F-181C-461F-BB14-4E7516DB6B4A}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<None Remove=".gitignore" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.11" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.11" />
<PackageReference Include="Avalonia" Version="0.10.12" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.12" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.11" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.11" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.12" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.12" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Aura.UI.FluentTheme\Aura.UI.FluentTheme.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<None Remove=".gitignore" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.11" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.11" />
<PackageReference Include="Avalonia" Version="0.10.12" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.12" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.11" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.11" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.12" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.12" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Aura.UI.FluentTheme\Aura.UI.FluentTheme.csproj" />
Expand Down
17 changes: 17 additions & 0 deletions Tests/MathsForUI.Test/MathTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using Aura.UI.Helpers;
using Aura.UI.Neumorphism.Controls;
using Avalonia;
using Avalonia.Media;
using Avalonia.Skia;
using System;
using Xunit;
using static Aura.UI.Helpers.Maths;
Expand Down Expand Up @@ -44,5 +47,19 @@ public void ThicknessTests(double width, double height, double p, double strokeW
var padding = new Thickness(p);
var r = size.WithHeight(Maths.TriangleHeightBySide(size.Width)).Inflate(padding + new Thickness(strokeWidth));
}

[Theory]
[InlineData("#ffffff", 0.6, "#ffffff", "#666666")]
[InlineData("#ffffff", 0.08, "#ffffff", "#ebebeb")]
[InlineData("#a34d4d", 0.33, "#d96666", "#6d3434")]
public void ColorLuminanceTests(string baseColor, double intensity, string expectedLightColor, string expectedDarkColor)
{
var color = Color.Parse(baseColor).ToSKColor();

var light = Neumor.ChangeColorLuminosity(color, intensity);
var dark = Neumor.ChangeColorLuminosity(color, intensity * -1);

Assert.Equal(light.ToString(), Color.Parse(expectedLightColor).ToSKColor().ToString());
}
}
}
3 changes: 2 additions & 1 deletion Tests/MathsForUI.Test/MathsForUI.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.0">
<PackageReference Include="coverlet.collector" Version="3.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Aura.UI.Neumorphism\Aura.UI.Neumorphism.csproj" />
<ProjectReference Include="..\..\src\Aura.UI\Aura.UI.csproj" />
</ItemGroup>

Expand Down
10 changes: 5 additions & 5 deletions build/version.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PackageVersion>0.1.5.0-dev-04</PackageVersion>
<AssemblyVersion>0.1.5.0</AssemblyVersion>
<Version>0.1.5.0</Version>
<PackageVersion>0.1.0-dev-01</PackageVersion>
<AssemblyVersion>0.1.0</AssemblyVersion>
<Version>0.1.0</Version>
<LangVersion>10.0</LangVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/PieroCastillo/Aura.UI</RepositoryUrl>
<RepositoryUrl>https://github.com/PieroCastillo/Aura.UI.Neumorphism/</RepositoryUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageTags>auraui avalonia controls ui navigationview url</PackageTags>
<PackageTags>auraui avalonia controls ui neumorphism</PackageTags>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<AvaloniaVersion>0.10.11</AvaloniaVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.12" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.ReactiveUI" Version="$(AvaloniaVersion)" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.12" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.12" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Aura.UI.Gallery\Aura.UI.Gallery.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion samples/Aura.UI.Gallery.Web/Aura.UI.Gallery.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.1" PrivateAssets="all" />
<PackageReference Include="Avalonia.Web.Blazor" Version="0.10.11" />
<PackageReference Include="Avalonia.Web.Blazor" Version="0.10.12" />
</ItemGroup>

<ItemGroup>
Expand Down
43 changes: 0 additions & 43 deletions samples/Aura.UI.Gallery/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,49 +70,6 @@ public override void OnFrameworkInitializationCompleted()

base.OnFrameworkInitializationCompleted();
}

public void NavigationViewStatic()
{
var animation = new Animation()
{
Duration = new TimeSpan(0,0,0,3),
FillMode = FillMode.Forward,
Easing = new CubicEaseOut(),
Children =
{
new KeyFrame()
{
Cue = new Cue(0),
Setters =
{
new Setter(TranslateTransform.YProperty, 0),
new Setter(Control.OpacityProperty, 1),
}
},
new KeyFrame()
{
Cue = new Cue(1),
Setters =
{
new Setter(TranslateTransform.YProperty, 0),
new Setter(Control.OpacityProperty, 1),
}
}
}
};

var style = new Style(x => x.
OfType<NavigationView>()
.Class(":normal")
.Template()
.OfType<ContentPresenter>()
.Name("PART_SelectedContentPresenter"));

style.Animations.Add(animation);

Styles.Add(style);
}

private AppSettings Settings
{
get;
Expand Down
12 changes: 6 additions & 6 deletions samples/Aura.UI.Gallery/Aura.UI.Gallery.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
<ItemGroup>
<PackageReference Include="XamlNameReferenceGenerator" Version="1.3.4" PrivateAssets="all" />
<PackageReference Include="AuraUtilities" Version="0.1.5.5" />
<PackageReference Include="Avalonia.AvaloniaEdit" Version="0.10.9" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.11" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.11" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="0.10.11" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.11" />
<PackageReference Include="Avalonia.Svg" Version="0.10.11.1" />
<PackageReference Include="Avalonia.AvaloniaEdit" Version="0.10.12.1" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.12" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.12" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="0.10.12" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.12" />
<PackageReference Include="Avalonia.Svg" Version="0.10.12" />
<PackageReference Include="jp2masa.Avalonia.Flexbox" Version="0.2.0" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/MiniSample/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

<Application.Styles>
<FluentTheme Mode="Light"/>
<StyleInclude Source="avares://Aura.UI.FluentTheme/AuraUI.xaml"/>
<!--<StyleInclude Source="avares://Aura.UI.FluentTheme/AuraUI.xaml"/>-->
</Application.Styles>
</Application>
11 changes: 6 additions & 5 deletions samples/MiniSample/MiniSample.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
Expand All @@ -10,14 +10,15 @@
<None Remove=".gitignore" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.11" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.11" />
<PackageReference Include="Avalonia" Version="0.10.12" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.12" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.11" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.11" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.12" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.12" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Aura.UI.FluentTheme\Aura.UI.FluentTheme.csproj" />
<ProjectReference Include="..\..\src\Aura.UI.Neumorphism\Aura.UI.Neumorphism.csproj" />
<ProjectReference Include="..\..\src\Aura.UI\Aura.UI.csproj" />
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions samples/MiniSample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Aura.UI.FluentTheme;
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.ReactiveUI;
Expand All @@ -19,6 +20,7 @@ public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.LogToTrace()
.UseAuraUIFluentTheme()
.UseReactiveUI();
}
}
80 changes: 79 additions & 1 deletion samples/MiniSample/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using Avalonia.Media;
using DynamicData.Binding;
using ReactiveUI;
using System;
using System.Collections.Generic;
using System.Text;
Expand All @@ -6,6 +9,81 @@ namespace MiniSample.ViewModels
{
public class MainWindowViewModel : ViewModelBase
{
public string Greeting => "Welcome to Avalonia!";
public MainWindowViewModel()
{
this.WhenPropertyChanged(x => x.R).Subscribe(x =>
{
BackgroundColor = Color.FromRgb((byte)R, (byte)G, (byte)B);
});


this.WhenPropertyChanged(x => x.G).Subscribe(x =>
{
BackgroundColor = Color.FromRgb((byte)R, (byte)G, (byte)B);
});


this.WhenPropertyChanged(x => x.B).Subscribe(x =>
{
BackgroundColor = Color.FromRgb((byte)R, (byte)G, (byte)B);
});
}

private Color _BackgroundColor = Color.Parse("#FFe0e0e0");
private double _Radius = 60;
private double _Distance = 20;
private double _Intensity = 0.15;
private double _Blur = 60;
private double _R = 0xe0;
private double _G = 0xe0;
private double _B = 0xe0;

public Color BackgroundColor
{
get => _BackgroundColor;
set => this.RaiseAndSetIfChanged(ref _BackgroundColor, value);
}

public double Radius
{
get => _Radius;
set => this.RaiseAndSetIfChanged(ref _Radius, value);
}

public double Distance
{
get => _Distance;
set => this.RaiseAndSetIfChanged(ref _Distance, value);
}

public double Intensity
{
get => _Intensity;
set => this.RaiseAndSetIfChanged(ref _Intensity, value);
}

public double Blur
{
get => _Blur;
set => this.RaiseAndSetIfChanged(ref _Blur, value);
}

public double R
{
get => _R;
set => this.RaiseAndSetIfChanged(ref _R, value);
}

public double G
{
get => _G;
set => this.RaiseAndSetIfChanged(ref _G, value);
}

public double B
{
get => _B;
set => this.RaiseAndSetIfChanged(ref _B, value);
}
}
}
Loading

0 comments on commit 2eea7c0

Please sign in to comment.