Skip to content

Commit

Permalink
Fixed menu code that was using View.Move inproperly
Browse files Browse the repository at this point in the history
  • Loading branch information
tig committed Mar 17, 2024
1 parent 7767bd1 commit 0cde0e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 4 additions & 2 deletions Terminal.Gui/Views/Menu/Menu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,8 @@ public override void OnDrawContent (Rectangle viewport)

if (item is null && BorderStyle != LineStyle.None)
{
Move (-1, i);
var s = ViewportToScreen (new (-1, i, 0, 0));
Driver.Move (s.X, s.Y);
Driver.AddRune (Glyphs.LeftTee);
}
else if (Frame.X < Driver.Cols)
Expand Down Expand Up @@ -837,7 +838,8 @@ public override void OnDrawContent (Rectangle viewport)
{
if (BorderStyle != LineStyle.None && SuperView?.Frame.Right - Frame.X > Frame.Width)
{
Move (Frame.Width - 2, i);
var s = ViewportToScreen (new (Frame.Width - 2, i, 0, 0));
Driver.Move (s.X, s.Y);
Driver.AddRune (Glyphs.RightTee);
}

Expand Down
6 changes: 1 addition & 5 deletions Terminal.Gui/Views/Menu/MenuBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -471,13 +471,9 @@ internal Menu openCurrentMenu
/// <inheritdoc/>
public override void OnDrawContent (Rectangle viewport)
{
Move (0, 0);
Driver.SetAttribute (GetNormalColor ());

for (var i = 0; i < Frame.Width; i++)
{
Driver.AddRune ((Rune)' ');
}
Clear ();

Move (1, 0);
var pos = 0;
Expand Down

0 comments on commit 0cde0e1

Please sign in to comment.