mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibGUI+WindowServer: Add menu minimum width support
This commit is contained in:
parent
adc845e0cb
commit
350affe406
8 changed files with 56 additions and 10 deletions
|
@ -89,6 +89,15 @@ void Menu::set_name(String name)
|
|||
}
|
||||
}
|
||||
|
||||
void Menu::set_minimum_width(int minimum_width)
|
||||
{
|
||||
m_minimum_width = minimum_width;
|
||||
if (m_menu_id != -1) {
|
||||
ConnectionToWindowServer::the().async_set_menu_minimum_width(m_menu_id, m_minimum_width);
|
||||
update_parent_menu_item();
|
||||
}
|
||||
}
|
||||
|
||||
void Menu::set_parent(Menu& menu, int submenu_index)
|
||||
{
|
||||
m_parent_menu = menu;
|
||||
|
@ -141,7 +150,7 @@ int Menu::realize_menu(RefPtr<Action> default_action)
|
|||
unrealize_menu();
|
||||
m_menu_id = s_menu_id_allocator.allocate();
|
||||
|
||||
ConnectionToWindowServer::the().async_create_menu(m_menu_id, m_name);
|
||||
ConnectionToWindowServer::the().async_create_menu(m_menu_id, m_name, m_minimum_width);
|
||||
|
||||
dbgln_if(MENU_DEBUG, "GUI::Menu::realize_menu(): New menu ID: {}", m_menu_id);
|
||||
VERIFY(m_menu_id > 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue