mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +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();
|
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()
|
QVector<void *> DockWidgetHelper::getVisibleNavigationItems()
|
||||||
{
|
{
|
||||||
m_navigationItems.clear();
|
m_navigationItems.clear();
|
||||||
|
@ -56,9 +56,6 @@ namespace vnotex
|
|||||||
|
|
||||||
void restoreDocks(const QStringList &p_visibleDocks);
|
void restoreDocks(const QStringList &p_visibleDocks);
|
||||||
|
|
||||||
// If there is any dock that does not belong to keep docks visible.
|
|
||||||
bool isAnyDockVisible() const;
|
|
||||||
|
|
||||||
// NavigationMode.
|
// NavigationMode.
|
||||||
protected:
|
protected:
|
||||||
QVector<void *> getVisibleNavigationItems() Q_DECL_OVERRIDE;
|
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();
|
saveStateAndGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -496,6 +499,11 @@ void MainWindow::resetStateAndGeometry()
|
|||||||
|
|
||||||
void MainWindow::setContentAreaExpanded(bool p_expanded)
|
void MainWindow::setContentAreaExpanded(bool p_expanded)
|
||||||
{
|
{
|
||||||
|
if (m_contentAreaExpanded == p_expanded) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_contentAreaExpanded = p_expanded;
|
||||||
if (p_expanded) {
|
if (p_expanded) {
|
||||||
// Store the state and hide.
|
// Store the state and hide.
|
||||||
m_visibleDocksBeforeExpand = m_dockWidgetHelper.hideDocks();
|
m_visibleDocksBeforeExpand = m_dockWidgetHelper.hideDocks();
|
||||||
@ -507,7 +515,7 @@ void MainWindow::setContentAreaExpanded(bool p_expanded)
|
|||||||
|
|
||||||
bool MainWindow::isContentAreaExpanded() const
|
bool MainWindow::isContentAreaExpanded() const
|
||||||
{
|
{
|
||||||
return !m_dockWidgetHelper.isAnyDockVisible();
|
return m_contentAreaExpanded;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::demoWidget()
|
void MainWindow::demoWidget()
|
||||||
|
@ -201,6 +201,8 @@ namespace vnotex
|
|||||||
Qt::WindowStates m_windowOldState = Qt::WindowMinimized;
|
Qt::WindowStates m_windowOldState = Qt::WindowMinimized;
|
||||||
|
|
||||||
QStringList m_visibleDocksBeforeExpand;
|
QStringList m_visibleDocksBeforeExpand;
|
||||||
|
|
||||||
|
bool m_contentAreaExpanded = false;
|
||||||
};
|
};
|
||||||
} // ns vnotex
|
} // ns vnotex
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user