Skip to content

Commit d6831ca

Browse files
Some refatoring in DockFocusController to improve code
1 parent aa25e1f commit d6831ca

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/DockFocusController.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -325,22 +325,22 @@ void CDockFocusController::notifyWidgetOrAreaRelocation(QWidget* DroppedWidget)
325325
}
326326

327327
CDockWidget* DockWidget = qobject_cast<CDockWidget*>(DroppedWidget);
328-
if (DockWidget)
329-
{
330-
d->ForceFocusChangedSignal = true;
331-
CDockManager::setWidgetFocus(DockWidget->tabWidget());
332-
return;
333-
}
328+
if (!DockWidget)
329+
{
330+
CDockAreaWidget* DockArea = qobject_cast<CDockAreaWidget*>(DroppedWidget);
331+
if (DockArea)
332+
{
333+
DockWidget = DockArea->currentDockWidget();
334+
}
335+
}
334336

335-
CDockAreaWidget* DockArea = qobject_cast<CDockAreaWidget*>(DroppedWidget);
336-
if (!DockArea)
337-
{
338-
return;
339-
}
337+
if (!DockWidget)
338+
{
339+
return;
340+
}
340341

341-
DockWidget = DockArea->currentDockWidget();
342342
d->ForceFocusChangedSignal = true;
343-
CDockManager::setWidgetFocus(DockWidget->tabWidget());
343+
CDockManager::setWidgetFocus(DockWidget->tabWidget());
344344
}
345345

346346

0 commit comments

Comments
 (0)