diff --git a/Terminal.Gui/Views/ScrollView.cs b/Terminal.Gui/Views/ScrollView.cs index 02b57510e..ff849bec9 100644 --- a/Terminal.Gui/Views/ScrollView.cs +++ b/Terminal.Gui/Views/ScrollView.cs @@ -43,19 +43,10 @@ public class ScrollView : View { ContentView _contentView; ScrollBarView _vertical, _horizontal; - /// - /// Initializes a new instance of the class using positioning. - /// - /// - public ScrollView (Rect frame) : base (frame) - { - SetInitialProperties (frame); - } - /// /// Initializes a new instance of the class using positioning. /// - public ScrollView () : base () + public ScrollView () { SetInitialProperties (Rect.Empty); } diff --git a/UICatalog/Scenarios/Clipping.cs b/UICatalog/Scenarios/Clipping.cs index 0912eb00d..5fb452395 100644 --- a/UICatalog/Scenarios/Clipping.cs +++ b/UICatalog/Scenarios/Clipping.cs @@ -25,7 +25,7 @@ public class Clipping : Scenario { }; Application.Top.Add (label); - var scrollView = new ScrollView (new Rect (3, 3, 50, 20)); + var scrollView = new ScrollView () { X = 3, Y = 3, Width = 50, Height = 20 }; scrollView.ColorScheme = Colors.Menu; scrollView.ContentSize = new Size (200, 100); //ContentOffset = new Point (0, 0), diff --git a/UnitTests/Views/ScrollViewTests.cs b/UnitTests/Views/ScrollViewTests.cs index 226faa28c..534a655d5 100644 --- a/UnitTests/Views/ScrollViewTests.cs +++ b/UnitTests/Views/ScrollViewTests.cs @@ -23,7 +23,7 @@ public class ScrollViewTests { Assert.True (sv.AutoHideScrollBars); Assert.True (sv.KeepContentAlwaysInViewport); - sv = new ScrollView (new Rect (1, 2, 20, 10)); + sv = new ScrollView () { X = 1, Y = 2, Width = 20, Height = 10 }; Assert.Equal (LayoutStyle.Absolute, sv.LayoutStyle); Assert.True (sv.CanFocus); Assert.Equal (new Rect (1, 2, 20, 10), sv.Frame); @@ -36,7 +36,9 @@ public class ScrollViewTests { [Fact] public void Adding_Views () { - var sv = new ScrollView (new Rect (0, 0, 20, 10)) { + var sv = new ScrollView () { + Width = 20, + Height = 10, ContentSize = new Size (30, 20) }; sv.Add (new View () { Width = 10, Height = 5 }, @@ -49,7 +51,9 @@ public class ScrollViewTests { [Fact] public void KeyBindings_Command () { - var sv = new ScrollView (new Rect (0, 0, 20, 10)) { + var sv = new ScrollView () { + Width = 20, + Height = 10, ContentSize = new Size (40, 20) }; sv.Add (new View () { Width = 20, Height = 5 }, @@ -606,7 +610,11 @@ public class ScrollViewTests { view.Add (new Label (rule.Repeat (size.Width / rule.Length)) { AutoSize = false, Width = Dim.Fill () }); view.Add (new Label (rule.Repeat (size.Height / rule.Length), TextDirection.TopBottom_LeftRight) { Height = Dim.Fill (), AutoSize = false }); view.Add (new Label ("[ Press me! ]") { X = 1, Y = 1 }); - var scrollView = new ScrollView (new Rect (1, 1, 15, 10)) { + var scrollView = new ScrollView () { + X = 1, + Y = 1, + Width = 15, + Height = 10, ContentSize = size, ShowHorizontalScrollIndicator = true, ShowVerticalScrollIndicator = true