Skip to content

Commit

Permalink
Fixes gui-cs#2882. TabView: 'Frame.DrawFrame(Rect, bool)' is obsolete…
Browse files Browse the repository at this point in the history
…: 'This method is obsolete in v2. Use use LineCanvas or Frame
  • Loading branch information
BDisp committed Nov 11, 2023
1 parent 545e422 commit a3c2d2b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Terminal.Gui/Views/TabView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,18 @@ public override void OnDrawContent (Rect contentArea)
int spaceAtBottom = Math.Max (0, GetTabHeight (false) - 1);
int startAtY = Math.Max (0, GetTabHeight (true) - 1);

Border.DrawFrame (new Rect (0, startAtY, Bounds.Width,
Math.Max (Bounds.Height - spaceAtBottom - startAtY, 0)), false);
var vts = ViewToScreen (new Rect (0, startAtY, Bounds.Width,
Math.Max (Bounds.Height - spaceAtBottom - startAtY, 0)));
LineCanvas.AddLine (new Point (vts.X, vts.Y), vts.Width,
Orientation.Horizontal, LineStyle.Single);
LineCanvas.AddLine (new Point (vts.Right - 1, vts.Y), vts.Height,
Orientation.Vertical, LineStyle.Single);
LineCanvas.AddLine (new Point (vts.X, vts.Bottom - 1), vts.Width,
Orientation.Horizontal, LineStyle.Single);
LineCanvas.AddLine (new Point (vts.X, vts.Y), vts.Height,
Orientation.Vertical, LineStyle.Single);

OnRenderLineCanvas ();
}

if (Tabs.Any ()) {
Expand Down

0 comments on commit a3c2d2b

Please sign in to comment.