Skip to content

Commit 2c7764e

Browse files
Properly implemented flag DockAreaHasCloseButton
1 parent bed99ea commit 2c7764e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

demo/MainWindow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ CMainWindow::CMainWindow(QWidget *parent) :
308308

309309
// Uncomment the following line to have the old style where the dock
310310
// area close button closes the active tab
311-
//d->DockManager->setConfigFlags({
312-
// CDockManager::DockAreaHasCloseButton | CDockManager::DockAreaCloseButtonClosesTab});
311+
//CDockManager::setConfigFlags({CDockManager::DockAreaHasCloseButton
312+
// | CDockManager::DockAreaCloseButtonClosesTab});
313313
connect(d->PerspectiveComboBox, SIGNAL(activated(const QString&)),
314314
d->DockManager, SLOT(openPerspective(const QString&)));
315315

src/DockAreaTitleBar.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ void DockAreaTitleBarPrivate::createButtons()
181181
#endif
182182
CloseButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
183183
CloseButton->setIconSize(QSize(16, 16));
184-
TopLayout->addWidget(CloseButton, 0);
184+
if (testConfigFlag(CDockManager::DockAreaHasCloseButton))
185+
{
186+
TopLayout->addWidget(CloseButton, 0);
187+
}
185188
_this->connect(CloseButton, SIGNAL(clicked()), SLOT(onCloseButtonClicked()));
186189
}
187190

0 commit comments

Comments
 (0)