Skip to content

Commit 6d067ba

Browse files
committed
[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
1 parent 7464ca6 commit 6d067ba

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎python/plugins/processing/script/ScriptEditorDialog.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def __init__(self, filePath=None, parent=None):
106106
self.actionDecreaseFontSize.triggered.connect(self.editor.zoomOut)
107107
self.editor.textChanged.connect(lambda: self.setHasChanged(True))
108108

109+
self.leFindText.returnPressed.connect(self.find)
109110
self.btnFind.clicked.connect(self.find)
110111
self.btnReplace.clicked.connect(self.replace)
111112
self.lastSearch = None
@@ -257,6 +258,8 @@ def replace(self):
257258

258259
def toggleSearchBox(self, checked):
259260
self.searchWidget.setVisible(checked)
261+
if (checked):
262+
self.leFindText.setFocus()
260263

261264
def _loadFile(self, filePath):
262265
with codecs.open(filePath, "r", encoding="utf-8") as f:

‎python/plugins/processing/ui/DlgScriptEditor.ui‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@
240240
<property name="checkable">
241241
<bool>true</bool>
242242
</property>
243+
<property name="shortcut">
244+
<string>Ctrl+F</string>
245+
</property>
243246
<property name="text">
244247
<string>Find &amp;&amp; &amp;Replace</string>
245248
</property>

0 commit comments

Comments
 (0)