Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/xwt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLluis Sanchez <lluis@xamarin.com>2013-11-13 00:04:43 +0400
committerLluis Sanchez <lluis@xamarin.com>2013-11-13 00:06:19 +0400
commitef54d065c721ce013d2dc96284629441aba1672b (patch)
tree952aeabcd4a034a587924807dfdae84be730e87a /Testing/Tests
parent31d15e6c9feb0f1c46a8531e0e4ffebb95f432b8 (diff)
[GTK] Another fix for label alignment
Diffstat (limited to 'Testing/Tests')
-rw-r--r--Testing/Tests/LabelTests.cs30
-rw-r--r--Testing/Tests/ReferenceImageVerifierDialog.cs21
-rw-r--r--Testing/Tests/ReferenceImages/Label.AlignCenter.png (renamed from Testing/Tests/ReferenceImages/Label.AlignCenter)bin1728 -> 1728 bytes
-rw-r--r--Testing/Tests/ReferenceImages/Label.AlignCenterWrapped.png (renamed from Testing/Tests/ReferenceImages/Label.AlignCenterWrapped)bin2773 -> 2773 bytes
-rw-r--r--Testing/Tests/ReferenceImages/Label.AlignCenterWrappedChangeText.pngbin0 -> 2116 bytes
-rw-r--r--Testing/Tests/ReferenceImages/Label.AlignLeft.png (renamed from Testing/Tests/ReferenceImages/Label.AlignLeft)bin1708 -> 1708 bytes
-rw-r--r--Testing/Tests/ReferenceImages/Label.AlignLeftWrapped.png (renamed from Testing/Tests/ReferenceImages/Label.AlignLeftWrapped)bin2786 -> 2786 bytes
-rw-r--r--Testing/Tests/ReferenceImages/Label.AlignRight.png (renamed from Testing/Tests/ReferenceImages/Label.AlignRight)bin1694 -> 1694 bytes
-rw-r--r--Testing/Tests/ReferenceImages/Label.AlignRightWrapped.png (renamed from Testing/Tests/ReferenceImages/Label.AlignRightWrapped)bin2813 -> 2813 bytes
9 files changed, 42 insertions, 9 deletions
diff --git a/Testing/Tests/LabelTests.cs b/Testing/Tests/LabelTests.cs
index 349f7d18..abb168dd 100644
--- a/Testing/Tests/LabelTests.cs
+++ b/Testing/Tests/LabelTests.cs
@@ -51,7 +51,7 @@ namespace Xwt
var la = new Label ("Some text here");
la.TextAlignment = Alignment.Center;
la.BackgroundColor = Xwt.Drawing.Colors.LightGray;
- CheckWidgetRender ("Label.AlignCenter", la);
+ CheckWidgetRender ("Label.AlignCenter.png", la);
}
[Test]
@@ -62,7 +62,25 @@ namespace Xwt
la.Wrap = WrapMode.Word;
la.WidthRequest = 200;
la.BackgroundColor = Xwt.Drawing.Colors.LightGray;
- CheckWidgetRender ("Label.AlignCenterWrapped", la);
+ CheckWidgetRender ("Label.AlignCenterWrapped.png", la);
+ }
+
+ [Test]
+ public void AlignCenterWrappedChangeText ()
+ {
+ var la = new Label ("Some text here");
+ la.TextAlignment = Alignment.Center;
+ la.Wrap = WrapMode.Word;
+ la.WidthRequest = 200;
+
+ using (var win = new Window { Width = 200, Height = 100 }) {
+ win.Content = la;
+ ShowWindow (win);
+ la.Text = "Some text here Some text here";
+ WaitForEvents ();
+ var img = Toolkit.CurrentEngine.RenderWidget (la);
+ ReferenceImageManager.CheckImage ("Label.AlignCenterWrappedChangeText.png", img);
+ }
}
[Test]
@@ -71,7 +89,7 @@ namespace Xwt
var la = new Label ("Some text here");
la.TextAlignment = Alignment.Start;
la.BackgroundColor = Xwt.Drawing.Colors.LightGray;
- CheckWidgetRender ("Label.AlignLeft", la);
+ CheckWidgetRender ("Label.AlignLeft.png", la);
}
[Test]
@@ -82,7 +100,7 @@ namespace Xwt
la.Wrap = WrapMode.Word;
la.WidthRequest = 200;
la.BackgroundColor = Xwt.Drawing.Colors.LightGray;
- CheckWidgetRender ("Label.AlignLeftWrapped", la);
+ CheckWidgetRender ("Label.AlignLeftWrapped.png", la);
}
[Test]
@@ -91,7 +109,7 @@ namespace Xwt
var la = new Label ("Some text here");
la.TextAlignment = Alignment.End;
la.BackgroundColor = Xwt.Drawing.Colors.LightGray;
- CheckWidgetRender ("Label.AlignRight", la);
+ CheckWidgetRender ("Label.AlignRight.png", la);
}
[Test]
@@ -102,7 +120,7 @@ namespace Xwt
la.Wrap = WrapMode.Word;
la.WidthRequest = 200;
la.BackgroundColor = Xwt.Drawing.Colors.LightGray;
- CheckWidgetRender ("Label.AlignRightWrapped", la);
+ CheckWidgetRender ("Label.AlignRightWrapped.png", la);
}
}
}
diff --git a/Testing/Tests/ReferenceImageVerifierDialog.cs b/Testing/Tests/ReferenceImageVerifierDialog.cs
index ceea784d..d04cfdf6 100644
--- a/Testing/Tests/ReferenceImageVerifierDialog.cs
+++ b/Testing/Tests/ReferenceImageVerifierDialog.cs
@@ -55,13 +55,28 @@ namespace Xwt
nameLabel.Font = nameLabel.Font.WithWeight (Xwt.Drawing.FontWeight.Bold);
img1 = new ImageView ();
- table.Add (img1, 0, 2, hexpand:true, vexpand:true);
+ var frame = new FrameBox {
+ Content = img1,
+ BorderColor = Xwt.Drawing.Colors.Gray,
+ BorderWidth = 1
+ };
+ table.Add (frame, 0, 2, hexpand:true, vexpand:true, hpos:WidgetPlacement.Center, vpos:WidgetPlacement.Center);
imgDiff = new ImageView ();
- table.Add (imgDiff, 1, 2, hexpand:true, vexpand:true);
+ frame = new FrameBox {
+ Content = imgDiff,
+ BorderColor = Xwt.Drawing.Colors.Gray,
+ BorderWidth = 1
+ };
+ table.Add (frame, 1, 2, hexpand:true, vexpand:true, hpos:WidgetPlacement.Center, vpos:WidgetPlacement.Center);
img2 = new ImageView ();
- table.Add (img2, 2, 2, hexpand:true, vexpand:true);
+ frame = new FrameBox {
+ Content = img2,
+ BorderColor = Xwt.Drawing.Colors.Gray,
+ BorderWidth = 1
+ };
+ table.Add (frame, 2, 2, hexpand:true, vexpand:true, hpos:WidgetPlacement.Center, vpos:WidgetPlacement.Center);
var buttonBox = new HBox ();
table.Add (buttonBox, 0, 3, colspan:2, hexpand:true);
diff --git a/Testing/Tests/ReferenceImages/Label.AlignCenter b/Testing/Tests/ReferenceImages/Label.AlignCenter.png
index 01b6eb60..01b6eb60 100644
--- a/Testing/Tests/ReferenceImages/Label.AlignCenter
+++ b/Testing/Tests/ReferenceImages/Label.AlignCenter.png
Binary files differ
diff --git a/Testing/Tests/ReferenceImages/Label.AlignCenterWrapped b/Testing/Tests/ReferenceImages/Label.AlignCenterWrapped.png
index bb5d6c78..bb5d6c78 100644
--- a/Testing/Tests/ReferenceImages/Label.AlignCenterWrapped
+++ b/Testing/Tests/ReferenceImages/Label.AlignCenterWrapped.png
Binary files differ
diff --git a/Testing/Tests/ReferenceImages/Label.AlignCenterWrappedChangeText.png b/Testing/Tests/ReferenceImages/Label.AlignCenterWrappedChangeText.png
new file mode 100644
index 00000000..f1398bc9
--- /dev/null
+++ b/Testing/Tests/ReferenceImages/Label.AlignCenterWrappedChangeText.png
Binary files differ
diff --git a/Testing/Tests/ReferenceImages/Label.AlignLeft b/Testing/Tests/ReferenceImages/Label.AlignLeft.png
index 1cf548f3..1cf548f3 100644
--- a/Testing/Tests/ReferenceImages/Label.AlignLeft
+++ b/Testing/Tests/ReferenceImages/Label.AlignLeft.png
Binary files differ
diff --git a/Testing/Tests/ReferenceImages/Label.AlignLeftWrapped b/Testing/Tests/ReferenceImages/Label.AlignLeftWrapped.png
index b60e96b7..b60e96b7 100644
--- a/Testing/Tests/ReferenceImages/Label.AlignLeftWrapped
+++ b/Testing/Tests/ReferenceImages/Label.AlignLeftWrapped.png
Binary files differ
diff --git a/Testing/Tests/ReferenceImages/Label.AlignRight b/Testing/Tests/ReferenceImages/Label.AlignRight.png
index a991200a..a991200a 100644
--- a/Testing/Tests/ReferenceImages/Label.AlignRight
+++ b/Testing/Tests/ReferenceImages/Label.AlignRight.png
Binary files differ
diff --git a/Testing/Tests/ReferenceImages/Label.AlignRightWrapped b/Testing/Tests/ReferenceImages/Label.AlignRightWrapped.png
index b084f5ad..b084f5ad 100644
--- a/Testing/Tests/ReferenceImages/Label.AlignRightWrapped
+++ b/Testing/Tests/ReferenceImages/Label.AlignRightWrapped.png
Binary files differ