2022.1.0-beta3 Renaming Box() to MinimalBox()
This commit is contained in:
@@ -23,7 +23,7 @@ namespace QuestPDF.Examples
|
||||
container
|
||||
.Background(Colors.Grey.Lighten2)
|
||||
.Padding(25)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Layers(layers =>
|
||||
{
|
||||
layers.Layer().Canvas((canvas, size) =>
|
||||
|
||||
@@ -474,7 +474,7 @@ namespace QuestPDF.Examples
|
||||
.Padding(15)
|
||||
.Border(4)
|
||||
.BorderColor(Colors.Blue.Medium)
|
||||
//.Box()
|
||||
//.MinimalBox()
|
||||
.Background(Colors.Grey.Lighten2)
|
||||
.Padding(15)
|
||||
.Text("Test of the \n box element", TextStyle.Default.Size(20));
|
||||
@@ -542,7 +542,7 @@ namespace QuestPDF.Examples
|
||||
{
|
||||
container
|
||||
.Background("#FFF")
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
|
||||
.Padding(25)
|
||||
|
||||
@@ -588,7 +588,7 @@ namespace QuestPDF.Examples
|
||||
|
||||
return element;
|
||||
})
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Background(Colors.White)
|
||||
.Padding(10)
|
||||
.Text($"Rotated {turns * 90}°", TextStyle.Default.Size(16));
|
||||
@@ -686,7 +686,7 @@ namespace QuestPDF.Examples
|
||||
|
||||
return element;
|
||||
})
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Background(Colors.White)
|
||||
.Padding(10)
|
||||
.Text($"Flipped {turns}", TextStyle.Default.Size(16));
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace QuestPDF.Examples
|
||||
decoration
|
||||
.Content()
|
||||
.PaddingTop(25)
|
||||
//.Box()
|
||||
//.MinimalBox()
|
||||
.Border(1)
|
||||
.Background(Colors.Grey.Lighten2)
|
||||
.Inlined(inlined =>
|
||||
@@ -94,7 +94,7 @@ namespace QuestPDF.Examples
|
||||
{
|
||||
container
|
||||
.Padding(20)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
.Background(Colors.Grey.Lighten4)
|
||||
.Inlined(inlined =>
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace QuestPDF.Examples
|
||||
{
|
||||
container
|
||||
.Padding(25)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
.Stack(stack =>
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace QuestPDF.Examples
|
||||
{
|
||||
container
|
||||
.Padding(10)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
.Table(table =>
|
||||
{
|
||||
@@ -61,7 +61,7 @@ namespace QuestPDF.Examples
|
||||
{
|
||||
container
|
||||
.Padding(10)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
.DefaultTextStyle(TextStyle.Default.Size(16))
|
||||
.Table(table =>
|
||||
@@ -125,7 +125,7 @@ namespace QuestPDF.Examples
|
||||
{
|
||||
container
|
||||
.Padding(10)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
.Table(table =>
|
||||
{
|
||||
@@ -158,7 +158,7 @@ namespace QuestPDF.Examples
|
||||
{
|
||||
container
|
||||
.Padding(10)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
.Table(table =>
|
||||
{
|
||||
@@ -193,7 +193,7 @@ namespace QuestPDF.Examples
|
||||
{
|
||||
container
|
||||
.Padding(10)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
.Table(table =>
|
||||
{
|
||||
@@ -307,7 +307,7 @@ namespace QuestPDF.Examples
|
||||
|
||||
container
|
||||
.Padding(10)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
.Decoration(decoration =>
|
||||
{
|
||||
@@ -400,7 +400,7 @@ namespace QuestPDF.Examples
|
||||
container
|
||||
.Padding(25)
|
||||
//.Background(Colors.Blue.Lighten2)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
//.Background(Colors.Red.Lighten2)
|
||||
.Table(table =>
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace QuestPDF.Examples
|
||||
{
|
||||
container
|
||||
.Padding(5)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
.Padding(10)
|
||||
.Text(text =>
|
||||
@@ -48,7 +48,7 @@ namespace QuestPDF.Examples
|
||||
{
|
||||
container
|
||||
.Padding(5)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
.Padding(10)
|
||||
.Text(text =>
|
||||
@@ -76,7 +76,7 @@ namespace QuestPDF.Examples
|
||||
{
|
||||
container
|
||||
.Padding(5)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
.Padding(10)
|
||||
.Text(text =>
|
||||
@@ -108,7 +108,7 @@ namespace QuestPDF.Examples
|
||||
container
|
||||
.Padding(20)
|
||||
.Padding(10)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
.Padding(5)
|
||||
.Padding(10)
|
||||
@@ -138,7 +138,7 @@ namespace QuestPDF.Examples
|
||||
container
|
||||
.Padding(20)
|
||||
.Padding(10)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
.Padding(5)
|
||||
.Padding(10)
|
||||
@@ -167,7 +167,7 @@ namespace QuestPDF.Examples
|
||||
container
|
||||
.Padding(20)
|
||||
.Padding(10)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
.Padding(5)
|
||||
.Padding(10)
|
||||
@@ -230,7 +230,7 @@ namespace QuestPDF.Examples
|
||||
container
|
||||
.Padding(20)
|
||||
.Padding(10)
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Border(1)
|
||||
.Padding(5)
|
||||
.Padding(10)
|
||||
|
||||
@@ -31,12 +31,12 @@ namespace QuestPDF.ReportSample.Layouts
|
||||
stack.Item().ShowOnce().Padding(5).AlignMiddle().Row(row =>
|
||||
{
|
||||
row.RelativeColumn(2).AlignMiddle().Text("PRIMARY HEADER", TextStyle.Default.Color(Colors.Grey.Darken3).Size(30).Bold());
|
||||
row.RelativeColumn(1).AlignRight().Box().AlignMiddle().Background(Colors.Blue.Darken2).Padding(30);
|
||||
row.RelativeColumn(1).AlignRight().MinimalBox().AlignMiddle().Background(Colors.Blue.Darken2).Padding(30);
|
||||
});
|
||||
stack.Item().SkipOnce().Padding(5).Row(row =>
|
||||
{
|
||||
row.RelativeColumn(2).Text("SECONDARY HEADER", TextStyle.Default.Color(Colors.Grey.Darken3).Size(30).Bold());
|
||||
row.RelativeColumn(1).AlignRight().Box().Background(Colors.Blue.Lighten4).Padding(15);
|
||||
row.RelativeColumn(1).AlignRight().MinimalBox().Background(Colors.Blue.Lighten4).Padding(15);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,13 +10,13 @@ namespace QuestPDF.UnitTests
|
||||
public class BoxTests
|
||||
{
|
||||
[Test]
|
||||
public void Measure() => SimpleContainerTests.Measure<Box>();
|
||||
public void Measure() => SimpleContainerTests.Measure<MinimalBox>();
|
||||
|
||||
[Test]
|
||||
public void Draw_Wrap()
|
||||
{
|
||||
TestPlan
|
||||
.For(x => new Box
|
||||
.For(x => new MinimalBox
|
||||
{
|
||||
Child = x.CreateChild()
|
||||
})
|
||||
@@ -29,7 +29,7 @@ namespace QuestPDF.UnitTests
|
||||
public void Measure_PartialRender()
|
||||
{
|
||||
TestPlan
|
||||
.For(x => new Box
|
||||
.For(x => new MinimalBox
|
||||
{
|
||||
Child = x.CreateChild()
|
||||
})
|
||||
@@ -43,7 +43,7 @@ namespace QuestPDF.UnitTests
|
||||
public void Measure_FullRender()
|
||||
{
|
||||
TestPlan
|
||||
.For(x => new Box
|
||||
.For(x => new MinimalBox
|
||||
{
|
||||
Child = x.CreateChild()
|
||||
})
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace QuestPDF.Elements
|
||||
.Layer()
|
||||
.ShowIf(!string.IsNullOrWhiteSpace(Text))
|
||||
.AlignCenter()
|
||||
.Box()
|
||||
.MinimalBox()
|
||||
.Background(Colors.White)
|
||||
.Padding(2)
|
||||
.Text(Text, TextStyle.Default.Color(Color).FontType(Fonts.Consolas).Size(8));
|
||||
|
||||
@@ -3,7 +3,7 @@ using QuestPDF.Infrastructure;
|
||||
|
||||
namespace QuestPDF.Elements
|
||||
{
|
||||
internal class Box : ContainerElement
|
||||
internal class MinimalBox : ContainerElement
|
||||
{
|
||||
internal override void Draw(Size availableSpace)
|
||||
{
|
||||
@@ -136,9 +136,16 @@ namespace QuestPDF.Fluent
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: deprecated Box method in QuestPDF 2022.1
|
||||
[Obsolete("This element has been renamed. Please use the MinimalBox method.")]
|
||||
public static IContainer Box(this IContainer element)
|
||||
{
|
||||
return element.Element(new Box());
|
||||
return element.Element(new MinimalBox());
|
||||
}
|
||||
|
||||
public static IContainer MinimalBox(this IContainer element)
|
||||
{
|
||||
return element.Element(new MinimalBox());
|
||||
}
|
||||
|
||||
public static IContainer Unconstrained(this IContainer element)
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace QuestPDF.Fluent
|
||||
Element = container
|
||||
});
|
||||
|
||||
return container.AlignBottom().Box();
|
||||
return container.AlignBottom().MinimalBox();
|
||||
}
|
||||
|
||||
internal void Compose(IContainer container)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<Authors>MarcinZiabek</Authors>
|
||||
<Company>CodeFlint</Company>
|
||||
<PackageId>QuestPDF</PackageId>
|
||||
<Version>2022.1.0-beta2</Version>
|
||||
<Version>2022.1.0-beta3</Version>
|
||||
<PackageDescription>QuestPDF is an open-source, modern and battle-tested library that can help you with generating PDF documents by offering friendly, discoverable and predictable C# fluent API.</PackageDescription>
|
||||
<PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/Resources/ReleaseNotes.txt"))</PackageReleaseNotes>
|
||||
<LangVersion>9</LangVersion>
|
||||
|
||||
Reference in New Issue
Block a user