| 1345 | } |
| 1346 | |
| 1347 | DToolButton *Controller::createDockButton(const WidgetInfo &info) |
| 1348 | { |
| 1349 | DToolButton *btn = new DToolButton(d->navigationToolBar); |
| 1350 | btn->setIcon(info.icon); |
| 1351 | btn->setToolTip(info.headerName.isEmpty() ? info.name : info.headerName); |
| 1352 | btn->setCheckable(true); |
| 1353 | connect(btn, &DToolButton::clicked, this, [=]() { |
| 1354 | auto &dockInfo = d->allWidgets[info.name]; |
| 1355 | if (!dockInfo.dockWidget) |
| 1356 | return; |
| 1357 | if (dockInfo.dockWidget->isVisible()) { |
| 1358 | d->mainWindow->hideWidget(dockInfo.name); |
| 1359 | btn->setChecked(false); |
| 1360 | dockInfo.hiddenByManual = true; |
| 1361 | } else { |
| 1362 | d->mainWindow->showWidget(dockInfo.name); |
| 1363 | btn->setChecked(true); |
| 1364 | dockInfo.hiddenByManual = false; |
| 1365 | } |
| 1366 | }, |
| 1367 | Qt::UniqueConnection); |
| 1368 | return btn; |
| 1369 | } |
| 1370 | |
| 1371 | void Controller::setTopToolItemVisible(Command *action, bool visible) |
| 1372 | { |
nothing calls this directly
no test coverage detected