Skip to content
Permalink
Browse files

[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
  • Loading branch information
nirvn committed May 19, 2018
1 parent 7464ca6 commit 6d067ba9e009f0fd98daac580c52584130907660
@@ -106,6 +106,7 @@ def __init__(self, filePath=None, parent=None):
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 @@ def replace(self):

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:
@@ -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>

0 comments on commit 6d067ba

Please sign in to comment.
You can’t perform that action at this time.