зеркало из https://github.com/DeGsoft/maui-linux.git
Родитель
81134f75c9
Коммит
f30ab27ae8
|
@ -0,0 +1,38 @@
|
|||
using Xamarin.Forms.CustomAttributes;
|
||||
using Xamarin.Forms.Internals;
|
||||
|
||||
#if UITEST
|
||||
using NUnit.Framework;
|
||||
using Xamarin.UITest;
|
||||
#endif
|
||||
|
||||
namespace Xamarin.Forms.Controls.Issues
|
||||
{
|
||||
[Preserve(AllMembers = true)]
|
||||
[Issue(IssueTracker.Github, 2728, "[macOS] Label FontAttributes Italic is not working")]
|
||||
public class Issue2728 : TestContentPage
|
||||
{
|
||||
protected override void Init()
|
||||
{
|
||||
var label = new Label { Text = "Hello Label", FontAttributes = FontAttributes.Italic };
|
||||
|
||||
Content = new StackLayout
|
||||
{
|
||||
Children = {
|
||||
label
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#if UITEST
|
||||
[Test]
|
||||
public void Issue2728TestsItalicLabel ()
|
||||
{
|
||||
RunningApp.WaitForElement(q => q.Text("Home"));
|
||||
RunningApp.Screenshot ("Label rendererd with italic font");
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
|
@ -732,6 +732,7 @@
|
|||
<Compile Include="$(MSBuildThisFileDirectory)Issue1323.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue2399.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue1729.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue2728.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue1667.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -231,8 +231,9 @@ namespace Xamarin.Forms.Platform.MacOS
|
|||
}
|
||||
if (italic)
|
||||
{
|
||||
Debug.WriteLine("Italic font requested, passing regular one");
|
||||
return NSFont.UserFontOfSize(size);
|
||||
var defaultFont = UIFont.SystemFontOfSize(size);
|
||||
var descriptor = defaultFont.FontDescriptor.FontDescriptorWithSymbolicTraits(NSFontSymbolicTraits.ItalicTrait);
|
||||
return NSFont.FromDescription(descriptor, 0);
|
||||
}
|
||||
#endif
|
||||
if (bold)
|
||||
|
|
Загрузка…
Ссылка в новой задаче