mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Restore the focus to the library view when the search button is clicked
This commit is contained in:
parent
566d56e71e
commit
5d254ef842
@ -182,7 +182,7 @@ class SearchBar(QWidget): # {{{
|
|||||||
l.addWidget(self.search_button)
|
l.addWidget(self.search_button)
|
||||||
self.search_button.setSizePolicy(QSizePolicy.Minimum,
|
self.search_button.setSizePolicy(QSizePolicy.Minimum,
|
||||||
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(
|
self.search_button.setToolTip(
|
||||||
_('Do Quick Search (you can also press the Enter key)'))
|
_('Do Quick Search (you can also press the Enter key)'))
|
||||||
|
|
||||||
|
@ -352,6 +352,10 @@ class SearchBoxMixin(object):
|
|||||||
if d.exec_() == QDialog.Accepted:
|
if d.exec_() == QDialog.Accepted:
|
||||||
self.search.set_search_string(d.search_string())
|
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):
|
def focus_to_library(self):
|
||||||
self.current_view().setFocus(Qt.OtherFocusReason)
|
self.current_view().setFocus(Qt.OtherFocusReason)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user