Added new CDockWidget feature flag focusable

This commit is contained in:
Uwe Kindler 2020-07-03 14:55:33 +02:00
parent 281127c2c3
commit 679fa81f6d
3 changed files with 11 additions and 3 deletions

View File

@ -381,7 +381,9 @@ void MainWindowPrivate::createContent()
//SpecialDockArea->setAllowedAreas({ads::LeftDockWidgetArea, ads::RightDockWidgetArea}); // just for testing
}
DockManager->addDockWidget(ads::LeftDockWidgetArea, createLongTextLabelDockWidget());
DockWidget = createLongTextLabelDockWidget();
DockWidget->setFeature(ads::CDockWidget::DockWidgetFocusable, false);
DockManager->addDockWidget(ads::LeftDockWidgetArea, DockWidget);
auto FileSystemWidget = createFileSystemTreeDockWidget();
FileSystemWidget->setFeature(ads::CDockWidget::DockWidgetFloatable, false);
appendFeaturStringToWindowTitle(FileSystemWidget);
@ -588,7 +590,7 @@ CMainWindow::CMainWindow(QWidget *parent) :
// uncomment the following line to enable focus highlighting of the dock
// widget that has the focus
// CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
// uncomment if you would like to enable an equal distribution of the
// available size of a splitter to all contained dock widgets

View File

@ -103,6 +103,11 @@ DockFocusControllerPrivate::DockFocusControllerPrivate(
//============================================================================
void DockFocusControllerPrivate::updateDockWidgetFocus(CDockWidget* DockWidget)
{
if (!DockWidget->features().testFlag(CDockWidget::DockWidgetFocusable))
{
return;
}
CDockAreaWidget* NewFocusedDockArea = nullptr;
if (FocusedDockWidget)
{

View File

@ -152,7 +152,8 @@ public:
DockWidgetFloatable = 0x04,
DockWidgetDeleteOnClose = 0x08, ///< deletes the dock widget when it is closed
CustomCloseHandling = 0x10,
DefaultDockWidgetFeatures = DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable,
DockWidgetFocusable = 0x20,
DefaultDockWidgetFeatures = DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable | DockWidgetFocusable,
AllDockWidgetFeatures = DefaultDockWidgetFeatures | DockWidgetDeleteOnClose | CustomCloseHandling,
NoDockWidgetFeatures = 0x00
};