Fix loading modified default layouts at the very beginning

This commit is contained in:
David Capello 2025-05-08 21:31:30 -03:00
parent 34aae80eab
commit 24046600ec
1 changed files with 10 additions and 11 deletions

View File

@ -519,18 +519,17 @@ void MainWindow::onResize(ui::ResizeEvent& ev)
// is received.
if (m_firstResize) {
m_firstResize = false;
setDefaultLayout();
const std::string layoutId = m_layoutSelector->activeLayoutId();
if (layoutId != Layout::kDefault) {
// Load the mirror layout
if (layoutId == Layout::kMirroredDefault) {
setMirroredDefaultLayout();
}
// Or load an user defined layout
else if (LayoutPtr layout = m_layoutSelector->activeLayout()) {
loadUserLayout(layout.get());
}
// If the layout is defined in the user layouts file, we loaded it
// (it can be a modified default/mirrored layout).
if (LayoutPtr layout = m_layoutSelector->activeLayout()) {
loadUserLayout(layout.get());
}
else if (m_layoutSelector->activeLayoutId() == Layout::kMirroredDefault) {
setMirroredDefaultLayout();
}
else {
setDefaultLayout();
}
}