| 858 | } |
| 859 | |
| 860 | void DockLayout::setupDefaultLayout() |
| 861 | { |
| 862 | pxAssert(m_is_active); |
| 863 | |
| 864 | if (!g_debugger_window) |
| 865 | return; |
| 866 | |
| 867 | const DockTables::DefaultDockLayout* base_layout = DockTables::defaultLayout(m_base_layout); |
| 868 | if (!base_layout) |
| 869 | return; |
| 870 | |
| 871 | std::vector<KDDockWidgets::QtWidgets::DockWidget*> groups(base_layout->groups.size(), nullptr); |
| 872 | |
| 873 | for (const DockTables::DefaultDockWidgetDescription& dock_description : base_layout->widgets) |
| 874 | { |
| 875 | const DockTables::DefaultDockGroupDescription& group = base_layout->groups.at(dock_description.group); |
| 876 | |
| 877 | DebuggerView* widget = nullptr; |
| 878 | for (auto& [unique_name, test_widget] : m_widgets) |
| 879 | if (test_widget->metaObject()->className() == dock_description.type) |
| 880 | widget = test_widget; |
| 881 | |
| 882 | if (!widget) |
| 883 | continue; |
| 884 | |
| 885 | auto view = static_cast<KDDockWidgets::QtWidgets::DockWidget*>( |
| 886 | KDDockWidgets::Config::self().viewFactory()->createDockWidget(widget->uniqueName())); |
| 887 | view->setWidget(widget); |
| 888 | |
| 889 | if (!groups.at(dock_description.group)) |
| 890 | { |
| 891 | KDDockWidgets::QtWidgets::DockWidget* parent = nullptr; |
| 892 | if (group.parent >= 0 && group.parent < static_cast<s32>(groups.size())) |
| 893 | parent = groups.at(group.parent); |
| 894 | |
| 895 | g_debugger_window->addDockWidget(view, group.location, parent); |
| 896 | |
| 897 | groups.at(dock_description.group) = view; |
| 898 | } |
| 899 | else |
| 900 | { |
| 901 | groups.at(dock_description.group)->addDockWidgetAsTab(view); |
| 902 | } |
| 903 | } |
| 904 | |
| 905 | for (KDDockWidgets::Core::Group* group : KDDockWidgets::DockRegistry::self()->groups()) |
| 906 | group->setCurrentTabIndex(0); |
| 907 | } |
| 908 | |
| 909 | std::pair<QString, u64> DockLayout::generateNewUniqueName(const char* type) |
| 910 | { |
nothing calls this directly
no test coverage detected