Merge pull request #65 from jfversluis/update-pre9
Fix build pipeline and update dependencies
This commit is contained in:
Коммит
d1fbdc7c3d
|
@ -83,8 +83,8 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="$(TargetFramework.Contains('-windows')) == true ">
|
<ItemGroup Condition="$(TargetFramework.Contains('-windows')) == true ">
|
||||||
<PackageReference Include="Microsoft.Graphics.Win2D" Version="0.8.2.23" />
|
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.0.26-experimental1" />
|
||||||
<PackageReference Include="Microsoft.Maui.Graphics.Win2D.WinUI.Desktop" Version="6.0.100-rc.1.382" />
|
<PackageReference Include="Microsoft.Maui.Graphics.Win2D.WinUI.Desktop" Version="6.0.101-preview.9.512" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
|
@ -12,7 +12,7 @@
|
||||||
<PackageId>Microsoft.Maui.Graphics.Controls</PackageId>
|
<PackageId>Microsoft.Maui.Graphics.Controls</PackageId>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Maui.Graphics" Version="6.0.100-rc.1.382" />
|
<PackageReference Include="Microsoft.Maui.Graphics" Version="6.0.101-preview.9.512" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="..\..\Microsoft.Maui.Graphics.Controls.MultiTargeting.targets" />
|
<Import Project="..\..\Microsoft.Maui.Graphics.Controls.MultiTargeting.targets" />
|
||||||
</Project>
|
</Project>
|
|
@ -11,10 +11,10 @@ namespace Microsoft.Maui.Graphics.Controls
|
||||||
public static PropertyMapper<IButton> PropertyMapper = new PropertyMapper<IButton>(ViewHandler.Mapper)
|
public static PropertyMapper<IButton> PropertyMapper = new PropertyMapper<IButton>(ViewHandler.Mapper)
|
||||||
{
|
{
|
||||||
[nameof(IButton.Background)] = ViewHandler.MapInvalidate,
|
[nameof(IButton.Background)] = ViewHandler.MapInvalidate,
|
||||||
[nameof(IButton.Text)] = ViewHandler.MapInvalidate,
|
[nameof(IText.Text)] = ViewHandler.MapInvalidate,
|
||||||
[nameof(IButton.TextColor)] = ViewHandler.MapInvalidate,
|
[nameof(ITextStyle.TextColor)] = ViewHandler.MapInvalidate,
|
||||||
[nameof(IButton.Font)] = ViewHandler.MapInvalidate,
|
[nameof(ITextStyle.Font)] = ViewHandler.MapInvalidate,
|
||||||
[nameof(IButton.CharacterSpacing)] = ViewHandler.MapInvalidate,
|
[nameof(ITextStyle.CharacterSpacing)] = ViewHandler.MapInvalidate,
|
||||||
[nameof(IButton.Padding)] = ViewHandler.MapInvalidate
|
[nameof(IButton.Padding)] = ViewHandler.MapInvalidate
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -31,13 +31,15 @@
|
||||||
{
|
{
|
||||||
canvas.SaveState();
|
canvas.SaveState();
|
||||||
|
|
||||||
canvas.FontColor = button.TextColor.WithDefault(Cupertino.Color.Label.Light.White);
|
var textColor = (button as ITextStyle)?.TextColor;
|
||||||
|
canvas.FontColor = textColor?.WithDefault(Cupertino.Color.Label.Light.White);
|
||||||
canvas.FontSize = 17f;
|
canvas.FontSize = 17f;
|
||||||
|
|
||||||
var height = dirtyRect.Height;
|
var height = dirtyRect.Height;
|
||||||
var width = dirtyRect.Width;
|
var width = dirtyRect.Width;
|
||||||
|
|
||||||
canvas.DrawString(button.Text, 0, 0, width, height, HorizontalAlignment.Center, VerticalAlignment.Center);
|
var text = (button as IText)?.Text;
|
||||||
|
canvas.DrawString(text, 0, 0, width, height, HorizontalAlignment.Center, VerticalAlignment.Center);
|
||||||
|
|
||||||
canvas.RestoreState();
|
canvas.RestoreState();
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,10 @@
|
||||||
canvas.SaveState();
|
canvas.SaveState();
|
||||||
|
|
||||||
if (button.IsEnabled)
|
if (button.IsEnabled)
|
||||||
canvas.FontColor = button.TextColor.WithDefault(Fluent.Color.Foreground.White);
|
{
|
||||||
|
var textColor = (button as ITextStyle)?.TextColor;
|
||||||
|
canvas.FontColor = textColor?.WithDefault(Fluent.Color.Foreground.White);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
canvas.FontColor = Fluent.Color.Foreground.NeutralPrimary.ToColor();
|
canvas.FontColor = Fluent.Color.Foreground.NeutralPrimary.ToColor();
|
||||||
|
|
||||||
|
@ -76,7 +79,8 @@
|
||||||
var height = dirtyRect.Height;
|
var height = dirtyRect.Height;
|
||||||
var width = dirtyRect.Width;
|
var width = dirtyRect.Width;
|
||||||
|
|
||||||
canvas.DrawString(button.Text, 0, 0, width, height, HorizontalAlignment.Center, VerticalAlignment.Center);
|
var text = (button as IText)?.Text;
|
||||||
|
canvas.DrawString(text, 0, 0, width, height, HorizontalAlignment.Center, VerticalAlignment.Center);
|
||||||
|
|
||||||
canvas.RestoreState();
|
canvas.RestoreState();
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,8 @@ namespace Microsoft.Maui.Graphics.Controls
|
||||||
|
|
||||||
canvas.FontName = "Roboto";
|
canvas.FontName = "Roboto";
|
||||||
|
|
||||||
canvas.FontColor = button.TextColor.WithDefault(button.IsEnabled ? Material.Color.White : Material.Color.Gray1);
|
var textColor = (button as ITextStyle)?.TextColor;
|
||||||
|
canvas.FontColor = textColor?.WithDefault(button.IsEnabled ? Material.Color.White : Material.Color.Gray1);
|
||||||
|
|
||||||
canvas.FontSize = Material.Font.Button;
|
canvas.FontSize = Material.Font.Button;
|
||||||
|
|
||||||
|
@ -51,7 +52,8 @@ namespace Microsoft.Maui.Graphics.Controls
|
||||||
|
|
||||||
var width = dirtyRect.Width;
|
var width = dirtyRect.Width;
|
||||||
|
|
||||||
canvas.DrawString(button.Text.ToUpper(), x, y, width, MaterialBackgroundHeight, HorizontalAlignment.Center, VerticalAlignment.Center);
|
var text = (button as IText)?.Text;
|
||||||
|
canvas.DrawString(text?.ToUpper(), x, y, width, MaterialBackgroundHeight, HorizontalAlignment.Center, VerticalAlignment.Center);
|
||||||
|
|
||||||
canvas.RestoreState();
|
canvas.RestoreState();
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ namespace Microsoft.Maui.Graphics.Controls
|
||||||
{
|
{
|
||||||
if (!(Drawable is MaterialEntryDrawable))
|
if (!(Drawable is MaterialEntryDrawable))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool hasText = !string.IsNullOrEmpty(VirtualView.Text);
|
bool hasText = !string.IsNullOrEmpty(VirtualView.Text);
|
||||||
|
|
||||||
if (hasText)
|
if (hasText)
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace Microsoft.Maui.Graphics.Controls
|
||||||
{
|
{
|
||||||
public static Color WithDefault(this Color color, string defaultColor)
|
public static Color WithDefault(this Color color, string defaultColor)
|
||||||
{
|
{
|
||||||
if (!color.IsDefault())
|
if (color != null && !color.IsDefault())
|
||||||
return color;
|
return color;
|
||||||
else
|
else
|
||||||
return Color.FromArgb(defaultColor);
|
return Color.FromArgb(defaultColor);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче