Clear input box when dialog hidden and focus input box when re-shown

This commit is contained in:
Kovid Goyal 2022-06-19 14:13:11 +05:30
parent cbe213a2aa
commit 27153f6580
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 2 additions and 0 deletions

View File

@ -93,6 +93,7 @@ class FTSDialog(Dialog):
def show(self): def show(self):
super().show() super().show()
self.scan_status.startup() self.scan_status.startup()
self.results_panel.on_show()
if __name__ == '__main__': if __name__ == '__main__':

View File

@ -793,6 +793,7 @@ class ResultsPanel(QWidget):
b = self.splitter.saveState() b = self.splitter.saveState()
gprefs['fts_search_splitter_state'] = bytearray(b) gprefs['fts_search_splitter_state'] = bytearray(b)
self.clear_results() self.clear_results()
self.sip.search_box.setText('')
def on_show(self): def on_show(self):
self.sip.search_box.setFocus(Qt.FocusReason.OtherFocusReason) self.sip.search_box.setFocus(Qt.FocusReason.OtherFocusReason)