-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The editor has been updated to the latest UI framework version. The new version has many breaking changes, if you think there is some new bug, please report it.
- Loading branch information
Showing
1,127 changed files
with
19,965 additions
and
10,866 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<!-- sadly AntlrBuildTools doesn't support non standard paths, so we need to revert obj/ and bin/ paths to the standard | ||
https://github.com/kaby76/Antlr4BuildTasks/issues/14 | ||
--> | ||
<BaseIntermediateOutputPath>$(MSBuildProjectDirectory)/obj</BaseIntermediateOutputPath> | ||
<IntermediateOutputPath>$(BaseIntermediateOutputPath)/$(Configuration)</IntermediateOutputPath> | ||
|
||
</PropertyGroup> | ||
</Project> |
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
Submodule AvaloniaEdit
updated
137 files
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,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Configurations>Debug;Release</Configurations> | ||
<Platforms>AnyCPU</Platforms> | ||
<Nullable>enable</Nullable> | ||
<WarningsAsErrors>$(WarningsAsErrors),nullable</WarningsAsErrors> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\AvaloniaStyles\AvaloniaStyles.csproj" /> | ||
</ItemGroup> | ||
|
||
<Import Project="..\Module.props" /> | ||
<Import Project="..\Avalonia.props" /> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/> | ||
</ItemGroup> | ||
</Project> |
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,16 @@ | ||
using Avalonia; | ||
|
||
namespace AvaloniaStyles.Desktop; | ||
|
||
public class Program | ||
{ | ||
static void Main(string[] args) | ||
=> BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); | ||
|
||
// App configuration, used by the entry point and previewer | ||
static AppBuilder BuildAvaloniaApp() | ||
=> AppBuilder.Configure<App>() | ||
.UsePlatformDetect() | ||
.WithInterFont() | ||
.LogToTrace(); | ||
} |
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 |
---|---|---|
@@ -1,86 +1,55 @@ | ||
using Avalonia; | ||
using Avalonia.Media; | ||
using Avalonia.Media.Immutable; | ||
using Avalonia.Metadata; | ||
using AvaloniaStyles.Utils; | ||
using HslColor = AvaloniaStyles.Utils.HslColor; | ||
|
||
namespace AvaloniaStyles.Controls; | ||
|
||
public class AccentSolidColorBrush : Brush, ISolidColorBrush | ||
public class Accent | ||
{ | ||
public static readonly StyledProperty<Color> BaseColorProperty = | ||
AvaloniaProperty.Register<AccentSolidColorBrush, Color>(nameof(BaseColor)); | ||
|
||
public static readonly StyledProperty<HslDiff> HueProperty = | ||
AvaloniaProperty.Register<AccentSolidColorBrush, HslDiff>(nameof(Hue)); | ||
|
||
static AccentSolidColorBrush() | ||
{ | ||
AffectsRender<AccentSolidColorBrush>(BaseColorProperty); | ||
AffectsRender<AccentSolidColorBrush>(HueProperty); | ||
} | ||
|
||
public AccentSolidColorBrush(Color color, double opacity = 1.0) | ||
{ | ||
BaseColor = color; | ||
Opacity = opacity; | ||
} | ||
|
||
public AccentSolidColorBrush(uint color) : this(Color.FromUInt32(color)) | ||
{ | ||
} | ||
|
||
public AccentSolidColorBrush() | ||
{ | ||
Opacity = 1; | ||
} | ||
|
||
/// <summary>Gets or sets the color of the brush.</summary> | ||
[Content] | ||
public Color BaseColor | ||
{ | ||
get => GetValue(BaseColorProperty); | ||
set => SetValue(BaseColorProperty, value); | ||
} | ||
|
||
public HslDiff Hue | ||
{ | ||
get => GetValue(HueProperty); | ||
set => SetValue(HueProperty, value); | ||
} | ||
|
||
/// <summary>Parses a brush string.</summary> | ||
/// <param name="s">The brush string.</param> | ||
/// <returns>The <see cref="P:Avalonia.Media.SolidColorBrush.Color" />.</returns> | ||
/// <remarks> | ||
/// Whereas <see cref="M:Avalonia.Media.Brush.Parse(System.String)" /> may return an immutable solid color brush, | ||
/// this method always returns a mutable <see cref="T:Avalonia.Media.SolidColorBrush" />. | ||
/// </remarks> | ||
public static AccentSolidColorBrush Parse(string s) | ||
{ | ||
ISolidColorBrush solidColorBrush1 = (ISolidColorBrush)Brush.Parse(s); | ||
return !(solidColorBrush1 is AccentSolidColorBrush solidColorBrush2) | ||
? new AccentSolidColorBrush(solidColorBrush1.Color) | ||
: solidColorBrush2; | ||
} | ||
|
||
public override string ToString() => Color.ToString(); | ||
|
||
/// <inheritdoc /> | ||
public override IBrush ToImmutable() => new ImmutableSolidColorBrush(this); | ||
|
||
public Color Color | ||
{ | ||
get | ||
{ | ||
var hsl = HslColor.FromRgba(BaseColor).Scale(Hue); | ||
return hsl.ToRgba(); | ||
} | ||
set | ||
{ | ||
var hsl = HslColor.FromRgba(value); | ||
//Hue = (float)hsl.H; | ||
BaseColor = value; | ||
} | ||
} | ||
public static readonly StyledProperty<Color> BaseColorProperty = | ||
AvaloniaProperty.RegisterAttached<Accent, SolidColorBrush, Color>("BaseColor"); | ||
|
||
public static readonly StyledProperty<HslDiff> HueProperty = | ||
AvaloniaProperty.RegisterAttached<Accent, SolidColorBrush, HslDiff>("Hue"); | ||
|
||
static Accent() | ||
{ | ||
HueProperty.Changed.AddClassHandler<SolidColorBrush>((brush, e) => | ||
{ | ||
Color baseColor; | ||
if (!brush.IsSet(BaseColorProperty)) | ||
{ | ||
baseColor = brush.Color; | ||
SetBaseColor(brush, baseColor); | ||
} | ||
else | ||
{ | ||
baseColor = brush.GetValue(BaseColorProperty); | ||
} | ||
var hsl = HslColor.FromRgba(baseColor).Scale(e.NewValue as HslDiff); | ||
brush.Color = hsl.ToRgba(); | ||
}); | ||
} | ||
|
||
public static Color GetBaseColor(AvaloniaObject obj) | ||
{ | ||
return obj.GetValue(BaseColorProperty); | ||
} | ||
|
||
public static void SetBaseColor(AvaloniaObject obj, Color value) | ||
{ | ||
obj.SetValue(BaseColorProperty, value); | ||
} | ||
|
||
public static HslDiff GetHue(AvaloniaObject obj) | ||
{ | ||
return obj.GetValue(HueProperty); | ||
} | ||
|
||
public static void SetHue(AvaloniaObject obj, HslDiff value) | ||
{ | ||
obj.SetValue(HueProperty, value); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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.