MainWindow: make Outline dock fixed at the right side by default

This commit is contained in:
Le Tan 2021-09-22 21:45:42 +08:00
parent 6689e8c84c
commit b8dd91e353
2 changed files with 14 additions and 7 deletions

View File

@ -378,7 +378,7 @@
"node_explorer_close_before_open_with_enabled" : true, "node_explorer_close_before_open_with_enabled" : true,
"search_panel_advanced_settings_visible" : true, "search_panel_advanced_settings_visible" : true,
"//comment" : "Docks to ignore when expanding content area of main window", "//comment" : "Docks to ignore when expanding content area of main window",
"main_window_keep_docks_expanding_content_area": [], "main_window_keep_docks_expanding_content_area": ["OutlineDock.vnotex"],
"snippet_panel_builtin_snippets_visible" : true "snippet_panel_builtin_snippets_visible" : true
} }
} }

View File

@ -90,24 +90,29 @@ void DockWidgetHelper::setupDocks()
m_dockIcons.resize(DockIndex::MaxDock); m_dockIcons.resize(DockIndex::MaxDock);
// The order of m_docks should be identical with enum DockIndex. // The order of m_docks should be identical with enum DockIndex.
QVector<int> tabifiedDockIndex;
tabifiedDockIndex.append(m_docks.size());
setupNavigationDock(); setupNavigationDock();
setupOutlineDock(); setupOutlineDock();
tabifiedDockIndex.append(m_docks.size());
setupHistoryDock(); setupHistoryDock();
tabifiedDockIndex.append(m_docks.size());
setupSearchDock(); setupSearchDock();
tabifiedDockIndex.append(m_docks.size());
setupSnippetDock(); setupSnippetDock();
for (int i = 1; i < m_docks.size(); ++i) {
m_mainWindow->tabifyDockWidget(m_docks[i - 1], m_docks[i]);
}
// Following are non-tabfieid docks.
setupLocationListDock(); setupLocationListDock();
setupShortcuts(); setupShortcuts();
for (int i = 1; i < tabifiedDockIndex.size(); ++i) {
m_mainWindow->tabifyDockWidget(m_docks[tabifiedDockIndex[i - 1]], m_docks[tabifiedDockIndex[i]]);
}
} }
void DockWidgetHelper::setupNavigationDock() void DockWidgetHelper::setupNavigationDock()
@ -131,7 +136,7 @@ void DockWidgetHelper::setupOutlineDock()
dock->setWidget(m_mainWindow->m_outlineViewer); dock->setWidget(m_mainWindow->m_outlineViewer);
dock->setFocusProxy(m_mainWindow->m_outlineViewer); dock->setFocusProxy(m_mainWindow->m_outlineViewer);
m_mainWindow->addDockWidget(Qt::LeftDockWidgetArea, dock); m_mainWindow->addDockWidget(Qt::RightDockWidgetArea, dock);
} }
void DockWidgetHelper::setupSearchDock() void DockWidgetHelper::setupSearchDock()
@ -406,6 +411,8 @@ void DockWidgetHelper::restoreDocks(const QStringList &p_visibleDocks)
// At least make one visible. // At least make one visible.
getDock(DockIndex::NavigationDock)->setVisible(true); getDock(DockIndex::NavigationDock)->setVisible(true);
} }
updateDockWidgetTabBar();
} }
bool DockWidgetHelper::isAnyDockVisible() const bool DockWidgetHelper::isAnyDockVisible() const