Skip to content

Fix combobox overflow in SelectDialog by removing fixed width constraint#92

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-menu-type-dropdown-issue
Draft

Fix combobox overflow in SelectDialog by removing fixed width constraint#92
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-menu-type-dropdown-issue

Conversation

Copy link

Copilot AI commented Feb 13, 2026

The "New Menu Type Selection" dialog's combobox extended beyond dialog boundaries. RComboBox has AutoSize=true with MinWidth=120px, but SelectDialog assigned a fixed 85px width and calculated form size before items were added. When items were added, the combobox auto-resized but the dialog did not.

Changes

  • Removed fixed width assignment in InitializeComponents()
  • Added AdjustLayout() method to dynamically position buttons and resize dialog based on actual combobox width
  • Modified Items setter to call AdjustLayout() after items are added
public string[] Items
{
    set
    {
        cmbItems.Items.Clear();
        cmbItems.Items.AddRange(value);
        AdjustLayout(); // Recalculate layout after RComboBox auto-sizes
    }
}

private void AdjustLayout()
{
    var a = 20.DpiZoom();
    btnOK.Left = cmbItems.Right + a;
    btnCancel.Left = btnOK.Right + a;
    ClientSize = new Size(btnCancel.Right + a, btnCancel.Bottom + a);
    cmbItems.AutosizeDropDownWidth();
}

Dialog now adapts to combobox's actual width after content is loaded.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: 新建菜单菜单类型选择框超出</issue_title>
<issue_description>### 检查项

  • 此错误未被报告过(可以在这里进行搜索)
  • 我已将 ContextMenuManager 更新到最新版本
  • 我已知晓:任何不合规定的 issue 都有可能被直接关闭

Windows

Windows 11

版本

3.6.2.1

复现流程

点击新建菜单项目:

Image

崩溃日志

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 13, 2026 09:15
… are added

Co-authored-by: Jack251970 <53996452+Jack251970@users.noreply.github.com>
Co-authored-by: Jack251970 <53996452+Jack251970@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix menu type selection box overflow issue Fix combobox overflow in SelectDialog by removing fixed width constraint Feb 13, 2026
Copilot AI requested a review from Jack251970 February 13, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 新建菜单菜单类型选择框超出

2 participants

Comments