Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Terminal.Gui/ViewBase/Layout/ViewManipulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Comment thread
tig marked this conversation as resolved.
}

/// <summary>
Expand All @@ -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 };
}

/// <summary>
/// Resizes view from the right edge, adjusting width only.
/// </summary>
/// <param name="location">Mouse position in view's coordinate space.</param>
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

Expand Down Expand Up @@ -132,7 +130,8 @@ public bool AdjustWidth (int delta)
{
return false;
}
_view.Width = newWidth;

_view.Frame = _view.Frame with { Width = newWidth };

return true;
}
Expand Down Expand Up @@ -161,7 +160,8 @@ public bool AdjustHeight (int delta)
{
return false;
}
_view.Height = newHeight;

_view.Frame = _view.Frame with { Height = newHeight };

return true;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions Terminal.Gui/Views/DialogTResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
tig marked this conversation as resolved.
}

/// <inheritdoc/>
Expand Down
Loading