16 changed files with 99 additions and 51 deletions
@ -1,10 +1,10 @@ |
|||||
// Copyright (c) The Avalonia Project. All rights reserved.
|
// Copyright (c) The Avalonia Project. All rights reserved.
|
||||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
||||
|
|
||||
namespace Avalonia.Controls |
namespace Avalonia.Media |
||||
{ |
{ |
||||
/// <summary>
|
/// <summary>
|
||||
/// Controls the wrapping mode in a <see cref="TextBlock"/>.
|
/// Controls the wrapping mode of text.
|
||||
/// </summary>
|
/// </summary>
|
||||
public enum TextWrapping |
public enum TextWrapping |
||||
{ |
{ |
||||
@ -0,0 +1,47 @@ |
|||||
|
// Copyright (c) The Avalonia Project. All rights reserved.
|
||||
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
||||
|
|
||||
|
using Avalonia.Controls; |
||||
|
using Avalonia.Layout; |
||||
|
using Avalonia.Media; |
||||
|
using Xunit; |
||||
|
|
||||
|
#if AVALONIA_CAIRO
|
||||
|
namespace Avalonia.Cairo.RenderTests.Controls |
||||
|
#elif AVALONIA_SKIA
|
||||
|
namespace Avalonia.Skia.RenderTests |
||||
|
#else
|
||||
|
namespace Avalonia.Direct2D1.RenderTests.Controls |
||||
|
#endif
|
||||
|
{ |
||||
|
public class TextBlockTests : TestBase |
||||
|
{ |
||||
|
public TextBlockTests() |
||||
|
: base(@"Controls\TextBlock") |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
[Fact] |
||||
|
public void Wrapping_NoWrap() |
||||
|
{ |
||||
|
Decorator target = new Decorator |
||||
|
{ |
||||
|
Padding = new Thickness(8), |
||||
|
Width = 200, |
||||
|
Height = 200, |
||||
|
Child = new TextBlock |
||||
|
{ |
||||
|
Background = Brushes.Red, |
||||
|
FontSize = 12, |
||||
|
Foreground = Brushes.Black, |
||||
|
Text = "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit", |
||||
|
VerticalAlignment = VerticalAlignment.Top, |
||||
|
TextWrapping = TextWrapping.NoWrap, |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
RenderToFile(target); |
||||
|
CompareImages(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
After Width: | Height: | Size: 1.2 KiB |
Loading…
Reference in new issue