diff --git a/src/Eto.Gtk/Forms/Controls/LabelHandler.cs b/src/Eto.Gtk/Forms/Controls/LabelHandler.cs index 48b4c59ab7..7e6db3b7d5 100644 --- a/src/Eto.Gtk/Forms/Controls/LabelHandler.cs +++ b/src/Eto.Gtk/Forms/Controls/LabelHandler.cs @@ -152,21 +152,18 @@ void SetWrap(WrapMode mode) case WrapMode.None: Control.Wrap = false; Control.LineWrap = false; - Control.SingleLineMode = true; break; case WrapMode.Word: Control.Wrap = true; Control.Layout.Wrap = Pango.WrapMode.WordChar; Control.LineWrapMode = Pango.WrapMode.WordChar; Control.LineWrap = true; - Control.SingleLineMode = false; break; case WrapMode.Character: Control.Wrap = true; Control.Layout.Wrap = Pango.WrapMode.Char; Control.LineWrapMode = Pango.WrapMode.Char; Control.LineWrap = true; - Control.SingleLineMode = false; break; default: throw new NotSupportedException(); diff --git a/src/Eto.WinForms/Forms/Controls/LabelHandler.cs b/src/Eto.WinForms/Forms/Controls/LabelHandler.cs index 70573fbab0..ca3d9cde2e 100644 --- a/src/Eto.WinForms/Forms/Controls/LabelHandler.cs +++ b/src/Eto.WinForms/Forms/Controls/LabelHandler.cs @@ -195,7 +195,6 @@ void SetStringFormat() switch (Wrap) { case WrapMode.None: - textFormat |= swf.TextFormatFlags.SingleLine; break; case WrapMode.Word: textFormat |= swf.TextFormatFlags.WordBreak; diff --git a/test/Eto.Test/Sections/Layouts/TableLayoutSection/ScalingSection.cs b/test/Eto.Test/Sections/Layouts/TableLayoutSection/ScalingSection.cs index f1989b9fb1..3c6530c5fa 100644 --- a/test/Eto.Test/Sections/Layouts/TableLayoutSection/ScalingSection.cs +++ b/test/Eto.Test/Sections/Layouts/TableLayoutSection/ScalingSection.cs @@ -50,7 +50,7 @@ public ScalingSection() tableLayout.SetColumnScale(2); tableLayout.SetRowScale(0); tableLayout.SetRowScale(2); - tableLayout.Add(new Label { Text = "2x2, should not scale and be centered", BackgroundColor = Colors.Red }, 1, 1); + tableLayout.Add(new Label { Text = "3x3, should not scale and be centered", BackgroundColor = Colors.Red }, 1, 1); layout.Add(tableLayout, yscale: true); Content = layout; diff --git a/test/Eto.Test/UnitTests/Forms/Controls/LabelTests.cs b/test/Eto.Test/UnitTests/Forms/Controls/LabelTests.cs index 562f9b7cad..ba3b18222c 100644 --- a/test/Eto.Test/UnitTests/Forms/Controls/LabelTests.cs +++ b/test/Eto.Test/UnitTests/Forms/Controls/LabelTests.cs @@ -23,5 +23,24 @@ public void ChangingTextAfterCreationShouldUpdateSize() return layout; }); } + + [Test, ManualTest] + public void WrapModeNoneShouldAllowNewLines() + { + ManualForm("Label should have two lines of text", form => + { + var label = new Label + { + Text = Utility.LoremTextWithTwoParagraphs, + Wrap = WrapMode.None + }; + var layout = new PixelLayout + { + Size = new Size(300, 200) + }; + layout.Add(label, 0, 0); + return layout; + }); + } } }