Let project search start with selected text (#1789)

This commit is contained in:
Veronica Berglyd Olsen
2024-04-02 22:51:04 +02:00
parent 3fb5d12487
commit 03cb6ccb2b
4 changed files with 25 additions and 15 deletions
+4 -1
View File
@@ -192,10 +192,13 @@ class GuiProjectSearch(QWidget):
)
return
def beginSearch(self) -> None:
def beginSearch(self, text: str = "") -> None:
"""Focus the search box and select its text, if any."""
self.searchText.setFocus()
self.searchText.selectAll()
if text:
self.searchText.setText(text.partition("\n")[0])
self.searchText.selectAll()
return
def closeProjectTasks(self) -> None: