Restore the focus to the library view when the search button is clicked

This commit is contained in:
Charles Haley 2010-12-01 08:18:36 +00:00
parent 566d56e71e
commit 5d254ef842
2 changed files with 5 additions and 1 deletions

View File

@ -182,7 +182,7 @@ class SearchBar(QWidget): # {{{
l.addWidget(self.search_button)
self.search_button.setSizePolicy(QSizePolicy.Minimum,
QSizePolicy.Minimum)
self.search_button.clicked.connect(parent.search.do_search)
self.search_button.clicked.connect(parent.do_search_button)
self.search_button.setToolTip(
_('Do Quick Search (you can also press the Enter key)'))

View File

@ -352,6 +352,10 @@ class SearchBoxMixin(object):
if d.exec_() == QDialog.Accepted:
self.search.set_search_string(d.search_string())
def do_search_button(self):
self.search.do_search()
self.focus_to_library()
def focus_to_library(self):
self.current_view().setFocus(Qt.OtherFocusReason)