| 728 | } |
| 729 | |
| 730 | void Controller::showRightspace() |
| 731 | { |
| 732 | auto &rightSpaceInfo = d->allWidgets[WN_RIGHTSPACE]; |
| 733 | if (!rightSpaceInfo.created) { |
| 734 | createDockWidget(d->allWidgets[WN_RIGHTSPACE]); |
| 735 | d->mainWindow->showWidget(WN_RIGHTSPACE); |
| 736 | d->mainWindow->resizeDock(WN_RIGHTSPACE, QSize(300, 300)); |
| 737 | |
| 738 | for (auto btn : d->rightspace->getAllToolBtn()) |
| 739 | d->mainWindow->addWidgetToDockHeader(WN_RIGHTSPACE, btn); |
| 740 | |
| 741 | auto titles = d->rightspace->allWidgetTitles(); |
| 742 | QList<QAction *> headers; |
| 743 | for (auto title : titles) { |
| 744 | QAction *action = new QAction(title, d->rightspace); |
| 745 | connect(action, &QAction::triggered, this, [=]() { d->rightspace->switchWidgetWorkspace(title); }); |
| 746 | headers.append(action); |
| 747 | } |
| 748 | d->mainWindow->setDockHeaderList(WN_RIGHTSPACE, headers); |
| 749 | d->mainWindow->setDockHeaderName(WN_RIGHTSPACE, d->rightspace->currentTitle()); |
| 750 | |
| 751 | d->rightspace->addedToController = true; |
| 752 | connect(d->rightspace, &WorkspaceWidget::workSpaceWidgeSwitched, this, [=](const QString &title) { |
| 753 | d->mainWindow->setDockHeaderName(WN_RIGHTSPACE, title); |
| 754 | }); |
| 755 | connect(rightSpaceInfo.dockWidget, &QDockWidget::visibilityChanged, d->showRightspaceBtn, [=](bool visible) { d->showRightspaceBtn->setChecked(visible); }); |
| 756 | } else if (!rightSpaceInfo.hiddenByManual) { |
| 757 | d->mainWindow->showWidget(WN_RIGHTSPACE); |
| 758 | } |
| 759 | d->currentDocks.append(WN_RIGHTSPACE); |
| 760 | } |
| 761 | |
| 762 | bool Controller::hasContextWidget(const QString &title) |
| 763 | { |
nothing calls this directly
no test coverage detected