[processing] tiny improvements to the script editor

- add a keyboard shortcut to toggle the find panel
- focus on the find text box when opening panel
- find text when hitting return
This commit is contained in:
nirvn 2018-05-19 17:17:41 +07:00 committed by Mathieu Pellerin
parent 7464ca686c
commit 6d067ba9e0
2 changed files with 6 additions and 0 deletions

View File

@ -106,6 +106,7 @@ class ScriptEditorDialog(BASE, WIDGET):
self.actionDecreaseFontSize.triggered.connect(self.editor.zoomOut)
self.editor.textChanged.connect(lambda: self.setHasChanged(True))
self.leFindText.returnPressed.connect(self.find)
self.btnFind.clicked.connect(self.find)
self.btnReplace.clicked.connect(self.replace)
self.lastSearch = None
@ -257,6 +258,8 @@ class ScriptEditorDialog(BASE, WIDGET):
def toggleSearchBox(self, checked):
self.searchWidget.setVisible(checked)
if (checked):
self.leFindText.setFocus()
def _loadFile(self, filePath):
with codecs.open(filePath, "r", encoding="utf-8") as f:

View File

@ -240,6 +240,9 @@
<property name="checkable">
<bool>true</bool>
</property>
<property name="shortcut">
<string>Ctrl+F</string>
</property>
<property name="text">
<string>Find &amp;&amp; &amp;Replace</string>
</property>