diff --git a/Terminal.Gui/ViewBase/Layout/ViewManipulator.cs b/Terminal.Gui/ViewBase/Layout/ViewManipulator.cs index 9875803ed1..8462180259 100644 --- a/Terminal.Gui/ViewBase/Layout/ViewManipulator.cs +++ b/Terminal.Gui/ViewBase/Layout/ViewManipulator.cs @@ -59,8 +59,7 @@ public void ResizeTop (Point location) { return; } - _view.Height = newHeight; - _view.Y = location.Y - _grabPoint.Y; + _view.Frame = _view.Frame with { Height = newHeight, Y = location.Y - _grabPoint.Y }; } /// @@ -82,15 +81,14 @@ public void ResizeLeft (Point location) { return; } - _view.Width = newWidth; - _view.X = location.X - _grabPoint.X; + _view.Frame = _view.Frame with { Width = newWidth, X = location.X - _grabPoint.X }; } /// /// Resizes view from the right edge, adjusting width only. /// /// Mouse position in view's coordinate space. - public void ResizeRight (Point location) => _view.Width = Math.Max (_minWidth, location.X - _view.Frame.X + _view.Margin.Thickness.Right + 1); + public void ResizeRight (Point location) => _view.Frame = _view.Frame with { Width = Math.Max (_minWidth, location.X - _view.Frame.X + _view.Margin.Thickness.Right + 1) }; #endregion @@ -132,7 +130,8 @@ public bool AdjustWidth (int delta) { return false; } - _view.Width = newWidth; + + _view.Frame = _view.Frame with { Width = newWidth }; return true; } @@ -161,7 +160,8 @@ public bool AdjustHeight (int delta) { return false; } - _view.Height = newHeight; + + _view.Frame = _view.Frame with { Height = newHeight }; return true; } @@ -192,8 +192,8 @@ public bool ResizeFromTop (int delta) return false; } int actualDelta = currentFrameHeight - newHeight; - _view.Y += actualDelta; - _view.Height = newHeight; + + _view.Frame = _view.Frame with { Y = _view.Frame.Y + actualDelta, Height = newHeight }; return true; } @@ -224,8 +224,8 @@ public bool ResizeFromLeft (int delta) return false; } int actualDelta = currentFrameWidth - newWidth; - _view.X += actualDelta; - _view.Width = newWidth; + + _view.Frame = _view.Frame with { X = _view.Frame.X + actualDelta, Width = newWidth }; return true; } diff --git a/Terminal.Gui/Views/DialogTResult.cs b/Terminal.Gui/Views/DialogTResult.cs index 2a984dac32..0954b8aabf 100644 --- a/Terminal.Gui/Views/DialogTResult.cs +++ b/Terminal.Gui/Views/DialogTResult.cs @@ -122,9 +122,11 @@ public override void EndInit () base.EndInit (); UpdateSizes (); +#if DIALOG_SCROLLBARS // Don't enable scrollbars until after initialized; otherwise they get created before // our frame has dimensions. ViewportSettings |= ViewportSettingsFlags.HasScrollBars; +#endif } ///