mainwindow: when maximizing panels, fallback to focused panel if hovered panel is null

Fixes #1403
This commit is contained in:
itsmattkc
2020-11-25 09:04:15 +11:00
parent 2b1700e088
commit 7cc64927b8
+8 -3
View File
@@ -274,9 +274,14 @@ void MainWindow::ToggleMaximizedPanel()
// Find the currently focused panel
PanelWidget* currently_hovered = PanelManager::instance()->CurrentlyHovered();
// If no panel is hovered, do nothing
if (currently_hovered == nullptr) {
return;
// If no panel is hovered, fallback to the currently active panel
if (!currently_hovered) {
currently_hovered = PanelManager::instance()->CurrentlyFocused();
// If no panel is hovered or focused, do nothing
if (!currently_hovered) {
return;
}
}
// If this panel is not actually on the main window, this is a no-op