The sidebar is a bit misbehaving

But some of the sidebar and welcomescreen things seems a bit like a hack
and trying to workaround features in other component, so hit it a bit
more with a hammer to behave.
This commit is contained in:
Sune Vuorela 2023-12-08 11:15:46 +01:00 committed by Carl Schwan
parent a0d40ab0bc
commit 5fb88dfb86

View File

@ -108,6 +108,10 @@ public:
m_stackedWidget = new QStackedWidget;
setWidget(m_stackedWidget);
// It seems that without requesting a specific minimum size, Qt
// somehow calculates a (0,-1) minimum size, and then Qt gets angry
// that negative sizes is not possible.
setMinimumSize(10, 10);
}
bool isLocked() const
@ -238,6 +242,12 @@ Shell::Shell(const QString &serializedOptions)
if (m_showSidebarAction && m_centralStackedWidget->currentWidget() != m_welcomeScreen) {
m_showSidebarAction->setChecked(visible);
}
if (m_centralStackedWidget->currentWidget() == m_welcomeScreen) {
// MainWindow tries hard to make its child dockwidgets shown, but during
// welcome screen we don't want to see the sidebar,
// so try a bit more to actually hide it.
m_sidebar->hide();
}
});
addDockWidget(Qt::LeftDockWidgetArea, m_sidebar);