| 480 | } |
| 481 | |
| 482 | QWidget* DockManager::createMenuBar(QWidget* original_menu_bar) |
| 483 | { |
| 484 | pxAssert(!m_menu_bar); |
| 485 | |
| 486 | m_menu_bar = new DockMenuBar(original_menu_bar); |
| 487 | |
| 488 | connect(m_menu_bar, &DockMenuBar::currentLayoutChanged, this, [this](DockLayout::Index layout_index) { |
| 489 | if (layout_index >= m_layouts.size()) |
| 490 | return; |
| 491 | |
| 492 | switchToLayout(layout_index); |
| 493 | }); |
| 494 | connect(m_menu_bar, &DockMenuBar::newButtonClicked, this, &DockManager::newLayoutClicked); |
| 495 | connect(m_menu_bar, &DockMenuBar::layoutMoved, this, &DockManager::layoutSwitcherTabMoved); |
| 496 | connect(m_menu_bar, &DockMenuBar::lockButtonToggled, this, &DockManager::setLayoutLockedAndSaveSetting); |
| 497 | connect(m_menu_bar, &DockMenuBar::layoutSwitcherContextMenuRequested, |
| 498 | this, &DockManager::openLayoutSwitcherContextMenu); |
| 499 | |
| 500 | updateLayoutSwitcher(); |
| 501 | |
| 502 | bool layout_locked = Host::GetBaseBoolSettingValue("Debugger/UserInterface", "LayoutLocked", true); |
| 503 | setLayoutLocked(layout_locked, false); |
| 504 | |
| 505 | return m_menu_bar; |
| 506 | } |
| 507 | |
| 508 | void DockManager::updateLayoutSwitcher() |
| 509 | { |