Support menu items that are null so they can be drawn as a menu separator (#304)

This commit is contained in:
Kasper B. Graversen
2020-02-29 17:46:18 +01:00
committed by GitHub
parent 0c72b8eae1
commit d4a7cef9cb

View File

@@ -124,12 +124,7 @@ namespace Terminal.Gui {
static Rect MakeFrame (int x, int y, MenuItem [] items)
{
int maxW = 0;
foreach (var item in items) {
var l = item.Width;
maxW = Math.Max (l, maxW);
}
int maxW = items.Max(z=>z?.Width) ?? 0;
return new Rect (x, y, maxW + 2, items.Length + 2);
}