mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2025-01-03 15:47:52 +03:00
yubioath-gui: select the contents of the search box when focused
When we hit the find shortcut, select the entire contents of the search box. This matches the behavior of e.g. Google Chrome's search box. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
This commit is contained in:
parent
d3eaf877cd
commit
385ea3480e
@ -98,7 +98,7 @@ class SearchBox(QtGui.QWidget):
|
||||
|
||||
self._shortcut_focus = QtGui.QShortcut(
|
||||
QtGui.QKeySequence.Find,
|
||||
self._lineedit, self._lineedit.setFocus)
|
||||
self._lineedit, self._set_focus)
|
||||
self._shortcut_clear = QtGui.QShortcut(
|
||||
QtGui.QKeySequence(self.tr("Esc")),
|
||||
self._lineedit, self._lineedit.clear)
|
||||
@ -108,6 +108,10 @@ class SearchBox(QtGui.QWidget):
|
||||
self._timer.setInterval(300)
|
||||
self._timer.timeout.connect(self._filter_changed)
|
||||
|
||||
def _set_focus(self):
|
||||
self._lineedit.setFocus()
|
||||
self._lineedit.selectAll()
|
||||
|
||||
def _text_changed(self, query):
|
||||
self._timer.stop()
|
||||
self._timer.start()
|
||||
|
Loading…
Reference in New Issue
Block a user