Fix starting panel resizing issues

This commit is contained in:
manongjohn 2022-04-07 00:56:12 -04:00
parent dce821346f
commit 285084188a
3 changed files with 7 additions and 16 deletions

View file

@ -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();

View file

@ -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);
}
}

View file

@ -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(); }
//========================================================================