mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Bug #2035039: Quickview window opens in the background
This commit is contained in:
parent
2fe2e6b8bd
commit
7738fb8105
@ -6,7 +6,7 @@ __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
|
||||
from qt.core import QAction
|
||||
from qt.core import QAction, QTimer
|
||||
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
from calibre.gui2.dialogs.quickview import Quickview
|
||||
@ -171,6 +171,10 @@ class ShowQuickviewAction(InterfaceAction):
|
||||
if show or (self.current_instance and not self.current_instance.is_closed):
|
||||
self.focus_quickview()
|
||||
self.current_instance.slave(idx)
|
||||
# This is needed because if this method is invoked from the library
|
||||
# view header context menu, the library view takes back the focus. I
|
||||
# don't know if this happens for any context menu.
|
||||
QTimer.singleShot(0, self.current_instance.set_focus)
|
||||
|
||||
def library_changed(self, db):
|
||||
'''
|
||||
|
Loading…
x
Reference in New Issue
Block a user