From 1952906829951e0904ddff5fc89209d29fab4352 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sun, 26 Feb 2023 10:35:14 +0100 Subject: [PATCH] Switch focus to tree when creating new item (#1376) --- novelwriter/gui/projtree.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/novelwriter/gui/projtree.py b/novelwriter/gui/projtree.py index d2cf564a..25bbba47 100644 --- a/novelwriter/gui/projtree.py +++ b/novelwriter/gui/projtree.py @@ -39,7 +39,7 @@ from PyQt5.QtWidgets import ( QVBoxLayout, QWidget ) -from novelwriter.enum import nwDocMode, nwItemType, nwItemClass, nwItemLayout, nwAlert +from novelwriter.enum import nwDocMode, nwItemType, nwItemClass, nwItemLayout, nwAlert, nwWidget from novelwriter.constants import nwHeaders, nwUnicode, trConst, nwLabels from novelwriter.core.coretools import DocMerger, DocSplitter from novelwriter.dialogs.docmerge import GuiDocMerge @@ -630,6 +630,7 @@ class GuiProjectTree(QTreeWidget): # Add the new item to the project tree self.revealNewTreeItem(tHandle, nHandle=nHandle, wordCount=True) + self.mainGui.switchFocus(nwWidget.TREE) return True