diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py
index 3af27d07..b932b42c 100644
--- a/nw/gui/doceditor.py
+++ b/nw/gui/doceditor.py
@@ -1815,7 +1815,7 @@ class GuiDocEditHeader(QWidget):
"""Capture a click on the title and ensure that the item is
selected in the project tree.
"""
- self.theParent.treeView.setSelectedHandle(self.theHandle)
+ self.theParent.treeView.setSelectedHandle(self.theHandle, doScroll=True)
return
# END Class GuiDocEditHeader
diff --git a/nw/gui/docviewer.py b/nw/gui/docviewer.py
index 93887fdf..17a7c079 100644
--- a/nw/gui/docviewer.py
+++ b/nw/gui/docviewer.py
@@ -542,7 +542,7 @@ class GuiDocViewHeader(QWidget):
"""Capture a click on the title and ensure that the item is
selected in the project tree.
"""
- self.theParent.treeView.setSelectedHandle(self.theHandle)
+ self.theParent.treeView.setSelectedHandle(self.theHandle, doScroll=True)
return
# END Class GuiDocViewHeader
diff --git a/nw/gui/projtree.py b/nw/gui/projtree.py
index 236b9f90..7c2bc7a4 100644
--- a/nw/gui/projtree.py
+++ b/nw/gui/projtree.py
@@ -569,14 +569,14 @@ class GuiProjectTree(QTreeWidget):
selHandles.append(selItems[n].data(self.C_NAME, Qt.UserRole))
return selHandles
- def setSelectedHandle(self, tHandle):
+ def setSelectedHandle(self, tHandle, doScroll=False):
"""Set a specific handle as the selected item.
"""
if tHandle in self.theMap:
self.clearSelection()
self.theMap[tHandle].setSelected(True)
selItems = self.selectedIndexes()
- if selItems:
+ if selItems and doScroll:
self.scrollTo(
selItems[0], QAbstractItemView.PositionAtCenter
)
diff --git a/tests/reference/gui/3_nwProject.nwx b/tests/reference/gui/3_nwProject.nwx
index 038ee8f2..4d6ef96a 100644
--- a/tests/reference/gui/3_nwProject.nwx
+++ b/tests/reference/gui/3_nwProject.nwx
@@ -41,14 +41,14 @@
ROOT
NOVEL
New
- True
+ False
-
New Chapter
FOLDER
NOVEL
New
- True
+ False
-
Just a Page