Add focus switch on welcome dialog (#1968)
This commit is contained in:
@@ -208,6 +208,7 @@ class GuiWelcome(NDialog):
|
||||
"""Show the create new project page."""
|
||||
self.mainStack.setCurrentWidget(self.tabNew)
|
||||
self._setButtonVisibility()
|
||||
self.tabNew.enterForm()
|
||||
return
|
||||
|
||||
@pyqtSlot()
|
||||
@@ -503,6 +504,8 @@ class _NewProjectPage(QWidget):
|
||||
self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAsNeeded)
|
||||
self.scrollArea.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAsNeeded)
|
||||
|
||||
self.enterForm = self.projectForm.enterForm
|
||||
|
||||
# Assemble
|
||||
# ========
|
||||
|
||||
@@ -696,6 +699,12 @@ class _NewProjectForm(QWidget):
|
||||
|
||||
return
|
||||
|
||||
def enterForm(self) -> None:
|
||||
"""Focus the project name field when entering the form."""
|
||||
self.projName.setFocus()
|
||||
self.projName.selectAll()
|
||||
return
|
||||
|
||||
def getProjectData(self) -> dict:
|
||||
"""Collect form data and return it as a dictionary."""
|
||||
roots = []
|
||||
|
||||
Reference in New Issue
Block a user