From 285084188a957c17cc062d843253491ccf080eb3 Mon Sep 17 00:00:00 2001 From: manongjohn Date: Thu, 7 Apr 2022 00:56:12 -0400 Subject: [PATCH] Fix starting panel resizing issues --- toonz/sources/toonz/main.cpp | 8 -------- toonz/sources/toonzqt/paletteviewer.cpp | 9 ++++++--- toonz/sources/toonzqt/tdockwindows.cpp | 6 +----- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/toonz/sources/toonz/main.cpp b/toonz/sources/toonz/main.cpp index 134c37e9..1dcf2e3f 100644 --- a/toonz/sources/toonz/main.cpp +++ b/toonz/sources/toonz/main.cpp @@ -807,10 +807,6 @@ int main(int argc, char *argv[]) { w.checkForUpdates(); DvDirModel::instance()->forceRefresh(); - // Disable the layout temporarily to avoid redistribution of panes that is - // executed during resizeEvents that are being called. It will reenable when - // the resizeEvent() is called - w.getCurrentRoom()->dockLayout()->setEnabled(false); w.show(); // Show floating panels only after the main window has been shown @@ -892,10 +888,6 @@ int main(int argc, char *argv[]) { a.installEventFilter(TApp::instance()); - // Disable the layout temporarily to avoid redistribution of panes that is - // executed during resizeEvents that are being called. It will reenable when - // the resizeEvent() is called - w.getCurrentRoom()->dockLayout()->setEnabled(false); int ret = a.exec(); TUndoManager::manager()->reset(); diff --git a/toonz/sources/toonzqt/paletteviewer.cpp b/toonz/sources/toonzqt/paletteviewer.cpp index f7beafe9..cd7a4546 100644 --- a/toonz/sources/toonzqt/paletteviewer.cpp +++ b/toonz/sources/toonzqt/paletteviewer.cpp @@ -641,9 +641,12 @@ void PaletteViewer::updateSavePaletteToolBar() { if (levelType == PLT_XSHLEVEL) enable = false; } act->setEnabled(enable); - } else if (m_viewType != STUDIO_PALETTE && i == 1) // move action - actions[i]->setVisible(enable); - else + } else if (m_viewType != STUDIO_PALETTE && i == 1) { // move action + // Do not hide when palette is not visible otherwise it causes + // panel redistribution at startup + bool moveVisible = isVisible() ? enable : true; + actions[i]->setVisible(moveVisible); + } else actions[i]->setEnabled(true); } } diff --git a/toonz/sources/toonzqt/tdockwindows.cpp b/toonz/sources/toonzqt/tdockwindows.cpp index 1f3c9af5..b18abd80 100644 --- a/toonz/sources/toonzqt/tdockwindows.cpp +++ b/toonz/sources/toonzqt/tdockwindows.cpp @@ -106,11 +106,7 @@ void TMainWindow::setSeparatorsThickness(int thick) { //---------------------------------------- -void TMainWindow::resizeEvent(QResizeEvent *event) { - // see main.cpp for why we are doing this - if (m_layout->isEnabled()) m_layout->redistribute(); - m_layout->setEnabled(true); -} +void TMainWindow::resizeEvent(QResizeEvent *event) { m_layout->redistribute(); } //========================================================================