Merge branch 'dev' into sweek/ci-fix

This commit is contained in:
James Clancey 2021-06-02 11:45:43 -08:00
Родитель f80475df4e 18239cbf94
Коммит eaa09fe04f
8 изменённых файлов: 69 добавлений и 11 удалений

2
External/Maui поставляемый

@ -1 +1 @@
Subproject commit 921cf8cdf2df06d2ee11b5325807e239a57c2a66
Subproject commit 896538dab06de814dea24b07263a8922aae32836

Просмотреть файл

@ -7,6 +7,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Comet", "..\src\Comet\Comet
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Comet.Tests", "..\tests\Comet.Tests\Comet.Tests.csproj", "{ED81BE11-73B6-45F7-A4D3-77FC8C48CDC2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials", "..\external\Maui\src\Essentials\src\Essentials.csproj", "{714508D8-6825-4EDE-A31D-516D929444F0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "..\external\Maui\src\Core\src\Core.csproj", "{F61D1659-1FEF-4327-BFDB-2418654357DF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -21,6 +25,14 @@ Global
{ED81BE11-73B6-45F7-A4D3-77FC8C48CDC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED81BE11-73B6-45F7-A4D3-77FC8C48CDC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED81BE11-73B6-45F7-A4D3-77FC8C48CDC2}.Release|Any CPU.Build.0 = Release|Any CPU
{714508D8-6825-4EDE-A31D-516D929444F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{714508D8-6825-4EDE-A31D-516D929444F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{714508D8-6825-4EDE-A31D-516D929444F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{714508D8-6825-4EDE-A31D-516D929444F0}.Release|Any CPU.Build.0 = Release|Any CPU
{F61D1659-1FEF-4327-BFDB-2418654357DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F61D1659-1FEF-4327-BFDB-2418654357DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F61D1659-1FEF-4327-BFDB-2418654357DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F61D1659-1FEF-4327-BFDB-2418654357DF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Просмотреть файл

@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using Microsoft.Maui;
using Microsoft.Maui.Graphics;
namespace Comet
{
public class CheckBox : View, ICheckBox
@ -26,6 +28,9 @@ namespace Comet
public Action<bool> IsOnChanged { get; private set; }
bool ICheckBox.IsChecked { get => IsOn; set => IsOnChanged?.Invoke(value); }
Paint ICheckBox.Foreground => this.GetPaintColor();
protected override string GetHandlerPropertyName(string property)
=> CheckBoxHandlerPropertyMapper.TryGetValue(property, out var value) ? value : property;
}

Просмотреть файл

@ -673,6 +673,26 @@ namespace Comet
Paint IFrameworkElement.Background => this.GetBackground();
double ITransform.TranslationX => this.GetEnvironment<double>(nameof(ITransform.TranslationX));
double ITransform.TranslationY => this.GetEnvironment<double>(nameof(ITransform.TranslationY));
double ITransform.Scale => this.GetEnvironment<double?>(nameof(ITransform.Scale)) ?? 1;
double ITransform.ScaleX => this.GetEnvironment<double?>(nameof(ITransform.ScaleX)) ?? 1;
double ITransform.ScaleY => this.GetEnvironment<double?>(nameof(ITransform.ScaleY)) ?? 1;
double ITransform.Rotation => this.GetEnvironment<double>(nameof(ITransform.Rotation));
double ITransform.RotationX => this.GetEnvironment<double>(nameof(ITransform.RotationX));
double ITransform.RotationY => this.GetEnvironment<double>(nameof(ITransform.RotationY));
double ITransform.AnchorX => this.GetEnvironment<double?>(nameof(ITransform.AnchorX)) ?? .5;
double ITransform.AnchorY => this.GetEnvironment<double?>(nameof(ITransform.AnchorY)) ?? .5;
Size IFrameworkElement.Arrange(Rectangle bounds)
{
LayoutSubviews(bounds);

Просмотреть файл

@ -41,6 +41,18 @@ namespace Comet
return color ?? defaultColor;
}
public static Paint GetPaintColor<T>(this T view, Paint defaultColor = null, ControlState state = ControlState.Default) where T : View
{
var color = view.GetEnvironment<Paint>(EnvironmentKeys.Colors.Color, state);
return color ?? defaultColor;
}
public static Paint GetPaintColor<T>(this T view, Type type, Paint defaultColor = null) where T : View
{
var color = view.GetEnvironment<Paint>(type, EnvironmentKeys.Colors.Color);
return color ?? defaultColor;
}
/// <summary>
/// Set the background color
/// </summary>

Просмотреть файл

@ -20,7 +20,7 @@ namespace Comet.Tests
}.Tag("grid");
}
[Fact]
[Fact(Skip ="Needs Fixing")]
public void TestView1()
{
var view = new GridTestView1();

Просмотреть файл

@ -20,7 +20,8 @@ namespace Comet.Tests
}.Tag("stack");
}
[Fact]
[Fact(Skip = "Needs Fixing")]
public void TestView1()
{
var view = new HStackTestView1();
@ -54,7 +55,8 @@ namespace Comet.Tests
Assert.Equal(new Rectangle(280, 0, 40, 12), text.Frame);
}
[Fact]
[Fact(Skip = "Needs Fixing")]
public void TestView1WithFrameConstraints()
{
var view = new HStackTestView1();
@ -86,7 +88,8 @@ namespace Comet.Tests
Assert.Equal(new Rectangle(280, 0, 40, 12), text.Frame);
}
[Fact]
[Fact(Skip = "Needs Fixing")]
public void TestView1WithMarginOnStack()
{
var view = new HStackTestView1();
@ -120,7 +123,8 @@ namespace Comet.Tests
Assert.Equal(new Rectangle(260, 0, 40, 12), text.Frame);
}
[Fact]
[Fact(Skip = "Needs Fixing")]
public void TestView1WithMarginAndFrameConstraintsOnStack()
{
var view = new HStackTestView1();
@ -154,7 +158,8 @@ namespace Comet.Tests
Assert.Equal(new Rectangle(260, 4, 40, 12), text.Frame);
}
[Fact]
[Fact(Skip = "Needs Fixing")]
public void TestView1WithMarginAndFrameConstraintsOnStackAndItems()
{
var view = new HStackTestView1();
@ -188,7 +193,8 @@ namespace Comet.Tests
Assert.Equal(new Rectangle(260, 8, 40, 12), text.Frame);
}
[Fact]
[Fact(Skip = "Needs Fixing")]
public void TestView1WithMarginAndFrameConstraintsOnItems()
{
var view = new HStackTestView1();
@ -222,7 +228,8 @@ namespace Comet.Tests
Assert.Equal(new Rectangle(260, 2, 40, 18), text.Frame);
}
[Fact]
[Fact(Skip = "Needs Fixing")]
public void TestView1WithMarginAndFrameConstraintsAndMarginOnItems()
{
var view = new HStackTestView1();
@ -269,7 +276,8 @@ namespace Comet.Tests
}.Tag("stack");
}
[Fact]
[Fact(Skip = "Needs Fixing")]
public void TestView2()
{
var view = new HStackTestView2();

Просмотреть файл

@ -32,7 +32,8 @@ namespace Comet.Tests
public readonly MyDataModel model;
}
[Fact]
[Fact(Skip = "Needs Fixing")]
public void GlobalBindingsOnlyRefreshTheViewThatHasTheGlobal()
{
int parentBodyBuildCount = 0;