mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Close all open panels when a search result is displayed
This commit is contained in:
parent
944795db53
commit
cb91b28566
@ -121,6 +121,12 @@ class UI:
|
|||||||
self.states.pop()
|
self.states.pop()
|
||||||
self.apply_state(self.states[-1])
|
self.apply_state(self.states[-1])
|
||||||
|
|
||||||
|
def close_all_panels(self):
|
||||||
|
if len(self.states) > 1:
|
||||||
|
while len(self.states) > 1:
|
||||||
|
self.states.pop()
|
||||||
|
self.apply_state(self.states[-1])
|
||||||
|
|
||||||
def replace_panel(self, state):
|
def replace_panel(self, state):
|
||||||
if len(self.states) > 1:
|
if len(self.states) > 1:
|
||||||
self.states.pop()
|
self.states.pop()
|
||||||
|
@ -250,7 +250,7 @@ class BooksView:
|
|||||||
return error_dialog(_('Could not change search query'), err + '', details=err.stack)
|
return error_dialog(_('Could not change search query'), err + '', details=err.stack)
|
||||||
query = {'search':self.interface_data.search_result.query, 'library_id':self.interface_data.library_id}
|
query = {'search':self.interface_data.search_result.query, 'library_id':self.interface_data.library_id}
|
||||||
window.history.pushState(None, '', encode_query(query))
|
window.history.pushState(None, '', encode_query(query))
|
||||||
boss.ui.close_panel()
|
boss.ui.close_all_panels()
|
||||||
self.update_fetching_status()
|
self.update_fetching_status()
|
||||||
window.scrollTo(0, 0)
|
window.scrollTo(0, 0)
|
||||||
elif end_type != 'abort':
|
elif end_type != 'abort':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user