     uiMenuBar.AddChild(spacer);
 }
 
-Menu@ CreateMenuItem(const String&in title, int accelKey = 0, int accelQual = 0, const String&in accel = "", int padding = 16)
+Menu@ CreateMenuItem(const String&in title, int accelKey = 0, int accelQual = 0, int padding = 16)
 {
     Menu@ menu = Menu(title);
     menu.style = uiStyle;

    Array<UIElement@> children = ui.root.GetChildren();
    for (uint i = 0; i < children.length; ++i)
    {
        if (children[i].type != textType)
            children[i].opacity = opacity;
    }
}

    return menu;
}

Text@ CreateAccelKeyText(int accelKey, int accelQual)
{
    Text@ accelKeyText = Text();
    accelKeyText.SetStyle(uiStyle, "EditorMenuText");
    accelKeyText.horizontalAlignment = HA_RIGHT;
    accelKeyText.indent = 1;
    
    String text;
    if (accelKey == KEY_DELETE)
        text = "Del";
    else if (accelKey == KEY_SPACE)
        text = "Space";
    else
        text.AppendUTF8(accelKey);
    if (accelQual & QUAL_ALT > 0)
        text = "Alt+" + text;
    if (accelQual & QUAL_SHIFT > 0)
        text = "Shift+" + text;
    if (accelQual & QUAL_CTRL > 0)
        text = "Ctrl+" + text;
    accelKeyText.text = text;
    
    return accelKeyText;
}

void AdjustAccelIndent(Window@ popup)
{
    // Find the maximum menu text width
    int maxWidth = 0;
    for (uint i = 0; i < popup.numChildren; ++i)
    {
        UIElement@ element = popup.children[i];
        if (element.type != menuType)	// Skip if not menu item
            continue;
        
        int width = element.children[0].width;
        if (width > maxWidth)
            maxWidth = width;
    }
    
    // Adjust the indent spacing to slightly wider than the maximum width
    maxWidth += 20;
    for (uint i = 0; i < popup.numChildren; ++i)
    {
        UIElement@ element = popup.children[i];
        if (element.type != menuType)
            continue;
        
        element = element.children[0];
        if (element.numChildren == 0)	// Skip if menu text does not have accel
            continue;
        
        element.children[0].indentSpacing = maxWidth;
    }
}

