mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 05:49:53 +08:00
MainWindow: fix content area expand
This commit is contained in:
parent
1d94617837
commit
815ef927cb
@ -490,17 +490,6 @@ void DockWidgetHelper::restoreDocks(const QStringList &p_visibleDocks)
|
||||
updateDockWidgetTabBar();
|
||||
}
|
||||
|
||||
bool DockWidgetHelper::isAnyDockVisible() const
|
||||
{
|
||||
const auto &keepDocks = ConfigMgr::getInst().getWidgetConfig().getMainWindowKeepDocksExpandingContentArea();
|
||||
for (const auto dock : m_docks) {
|
||||
if (!dock->isFloating() && dock->isVisible() && !keepDocks.contains(dock->objectName())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QVector<void *> DockWidgetHelper::getVisibleNavigationItems()
|
||||
{
|
||||
m_navigationItems.clear();
|
||||
|
@ -56,9 +56,6 @@ namespace vnotex
|
||||
|
||||
void restoreDocks(const QStringList &p_visibleDocks);
|
||||
|
||||
// If there is any dock that does not belong to keep docks visible.
|
||||
bool isAnyDockVisible() const;
|
||||
|
||||
// NavigationMode.
|
||||
protected:
|
||||
QVector<void *> getVisibleNavigationItems() Q_DECL_OVERRIDE;
|
||||
|
@ -400,6 +400,9 @@ void MainWindow::closeEvent(QCloseEvent *p_event)
|
||||
}
|
||||
}
|
||||
|
||||
// Do not expand the content area.
|
||||
setContentAreaExpanded(false);
|
||||
|
||||
saveStateAndGeometry();
|
||||
}
|
||||
|
||||
@ -496,6 +499,11 @@ void MainWindow::resetStateAndGeometry()
|
||||
|
||||
void MainWindow::setContentAreaExpanded(bool p_expanded)
|
||||
{
|
||||
if (m_contentAreaExpanded == p_expanded) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_contentAreaExpanded = p_expanded;
|
||||
if (p_expanded) {
|
||||
// Store the state and hide.
|
||||
m_visibleDocksBeforeExpand = m_dockWidgetHelper.hideDocks();
|
||||
@ -507,7 +515,7 @@ void MainWindow::setContentAreaExpanded(bool p_expanded)
|
||||
|
||||
bool MainWindow::isContentAreaExpanded() const
|
||||
{
|
||||
return !m_dockWidgetHelper.isAnyDockVisible();
|
||||
return m_contentAreaExpanded;
|
||||
}
|
||||
|
||||
void MainWindow::demoWidget()
|
||||
|
@ -201,6 +201,8 @@ namespace vnotex
|
||||
Qt::WindowStates m_windowOldState = Qt::WindowMinimized;
|
||||
|
||||
QStringList m_visibleDocksBeforeExpand;
|
||||
|
||||
bool m_contentAreaExpanded = false;
|
||||
};
|
||||
} // ns vnotex
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user