Allow clearing search history via context menu

This commit is contained in:
Kovid Goyal 2020-01-21 21:48:01 +05:30
parent b0377d7eb5
commit d54f29bc0e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -170,6 +170,12 @@ class SearchBox(HistoryComboBox):
self.history_saved.emit(self.text(), self.history)
return ret
def contextMenuEvent(self, event):
menu = self.lineEdit().createStandardContextMenu()
menu.addSeparator()
menu.addAction(_('Clear search history'), self.clear_history)
menu.exec_(event.globalPos())
class SearchInput(QWidget): # {{{