mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-03-15 02:29:52 +08:00
Fixed #711 - Focus loss when closing other dock widgets
This commit is contained in:
parent
782589523e
commit
e836b154eb
@ -423,6 +423,13 @@ CDockWidget* CDockFocusController::focusedDockWidget() const
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
CDockAreaWidget* CDockFocusController::focusedDockArea() const
|
||||
{
|
||||
return d->FocusedArea.data();
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
void CDockFocusController::setDockWidgetTabPressed(bool Value)
|
||||
{
|
||||
|
@ -69,6 +69,12 @@ public:
|
||||
*/
|
||||
CDockWidget* focusedDockWidget() const;
|
||||
|
||||
/**
|
||||
* Returns the dock area that contains the focusedDockWidget() or nullptr if
|
||||
* the focused dock widget is not in this area.
|
||||
*/
|
||||
CDockAreaWidget* focusedDockArea() const;
|
||||
|
||||
/**
|
||||
* Request focus highlighting for the given dock widget assigned to the tab
|
||||
* given in Tab parameter
|
||||
|
@ -599,9 +599,9 @@ void CDockWidgetTab::setActiveTab(bool active)
|
||||
if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting) && !d->DockWidget->dockManager()->isRestoringState())
|
||||
{
|
||||
bool UpdateFocusStyle = false;
|
||||
if (active && !hasFocus())
|
||||
{
|
||||
//setFocus(Qt::OtherFocusReason);
|
||||
// Update the focus only, if this the dock area of this tab is the focused dock area
|
||||
if (active && !hasFocus() && (d->focusController()->focusedDockArea() == this->dockAreaWidget()))
|
||||
{
|
||||
d->focusController()->setDockWidgetTabFocused(this);
|
||||
UpdateFocusStyle = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user