clear dock widget focus on repin

This commit is contained in:
Syarif Fakhri 2022-09-15 13:04:49 +08:00
parent 59108ed245
commit 060313c11f
3 changed files with 15 additions and 0 deletions

View File

@ -53,6 +53,7 @@
#include "DockWidgetTab.h"
#include "DockWidgetSideTab.h"
#include "DockAreaTitleBar.h"
#include "DockFocusController.h"
#include <functional>
#include <iostream>
@ -1508,6 +1509,7 @@ COverlayDockContainer* CDockContainerWidget::createAndInitializeDockWidgetOverla
const auto dockContainer = new COverlayDockContainer(DockWidget, area, this);
dockContainer->hide();
d->DockManager->dockFocusController()->clearDockWidgetFocus(DockWidget);
return dockContainer;
}

View File

@ -320,6 +320,14 @@ void CDockFocusController::setDockWidgetTabFocused(CDockWidgetTab* Tab)
}
//===========================================================================
void CDockFocusController::clearDockWidgetFocus(CDockWidget* dockWidget)
{
dockWidget->clearFocus();
updateDockWidgetFocusStyle(dockWidget, false);
}
//===========================================================================
void CDockFocusController::setDockWidgetFocused(CDockWidget* focusedNow)
{

View File

@ -75,6 +75,11 @@ public:
*/
void setDockWidgetTabFocused(CDockWidgetTab* Tab);
/*
* Request clear focus for a dock widget
*/
void clearDockWidgetFocus(CDockWidget* dockWidget);
public Q_SLOTS:
/**
* Request a focus change to the given dock widget