From 2c7764ecf7e2e9b307f8d9239a35ce5be3f5d94c Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Thu, 12 Sep 2019 21:24:48 +0200 Subject: [PATCH] Properly implemented flag DockAreaHasCloseButton --- demo/MainWindow.cpp | 4 ++-- src/DockAreaTitleBar.cpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/demo/MainWindow.cpp b/demo/MainWindow.cpp index 28eca88..bf09f44 100644 --- a/demo/MainWindow.cpp +++ b/demo/MainWindow.cpp @@ -308,8 +308,8 @@ CMainWindow::CMainWindow(QWidget *parent) : // Uncomment the following line to have the old style where the dock // area close button closes the active tab - //d->DockManager->setConfigFlags({ - // CDockManager::DockAreaHasCloseButton | CDockManager::DockAreaCloseButtonClosesTab}); + //CDockManager::setConfigFlags({CDockManager::DockAreaHasCloseButton + // | CDockManager::DockAreaCloseButtonClosesTab}); connect(d->PerspectiveComboBox, SIGNAL(activated(const QString&)), d->DockManager, SLOT(openPerspective(const QString&))); diff --git a/src/DockAreaTitleBar.cpp b/src/DockAreaTitleBar.cpp index 64e6bab..4553938 100644 --- a/src/DockAreaTitleBar.cpp +++ b/src/DockAreaTitleBar.cpp @@ -181,7 +181,10 @@ void DockAreaTitleBarPrivate::createButtons() #endif CloseButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); CloseButton->setIconSize(QSize(16, 16)); - TopLayout->addWidget(CloseButton, 0); + if (testConfigFlag(CDockManager::DockAreaHasCloseButton)) + { + TopLayout->addWidget(CloseButton, 0); + } _this->connect(CloseButton, SIGNAL(clicked()), SLOT(onCloseButtonClicked())); }