MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / createDockButton

Method createDockButton

src/plugins/core/uicontroller/controller.cpp:1347–1369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1345}
1346
1347DToolButton *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
1371void Controller::setTopToolItemVisible(Command *action, bool visible)
1372{

Callers

nothing calls this directly

Calls 8

connectFunction · 0.85
setCheckableMethod · 0.80
isVisibleMethod · 0.80
showWidgetMethod · 0.80
setIconMethod · 0.45
isEmptyMethod · 0.45
hideWidgetMethod · 0.45
setCheckedMethod · 0.45

Tested by

no test coverage detected