mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Support menu items that are null so they can be drawn as a menu separator (#304)
This commit is contained in:
committed by
GitHub
parent
0c72b8eae1
commit
d4a7cef9cb
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user