mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Make the Inspector dock widget work
This commit is contained in:
parent
fa23f3d43f
commit
56baf848fc
@ -25,14 +25,15 @@ class EbookViewer(MainWindow):
|
||||
MainWindow.__init__(self, None)
|
||||
self.book_prepared.connect(self.load_finished, type=Qt.QueuedConnection)
|
||||
|
||||
def create_dock(title, name, areas=Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea):
|
||||
def create_dock(title, name, area, areas=Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea):
|
||||
ans = QDockWidget(title, self)
|
||||
ans.setObjectName(name)
|
||||
ans.close()
|
||||
self.addDockWidget(area, ans)
|
||||
ans.setVisible(False)
|
||||
return ans
|
||||
|
||||
self.toc_dock = create_dock(_('Table of Contents'), 'toc-dock')
|
||||
self.inspector_dock = create_dock(_('Inspector'), 'inspector')
|
||||
self.toc_dock = create_dock(_('Table of Contents'), 'toc-dock', Qt.LeftDockWidgetArea)
|
||||
self.inspector_dock = create_dock(_('Inspector'), 'inspector', Qt.RightDockWidgetArea)
|
||||
self.web_view = WebView(self)
|
||||
self.setCentralWidget(self.web_view)
|
||||
|
||||
|
@ -221,7 +221,9 @@ class WebView(RestartingWebEngineView):
|
||||
self.setAcceptDrops(False)
|
||||
self.clear()
|
||||
if parent is not None:
|
||||
self.inspector = Inspector(parent.toc_dock.toggleViewAction(), self)
|
||||
self.inspector = Inspector(parent.inspector_dock.toggleViewAction(), self)
|
||||
parent.inspector_dock.setWidget(self.inspector)
|
||||
# QTimer.singleShot(100, lambda: (parent.inspector_dock.setVisible(True), parent.inspector_dock.setMinimumWidth(450)))
|
||||
|
||||
def render_process_died(self):
|
||||
if self.dead_renderer_error_shown:
|
||||
|
Loading…
x
Reference in New Issue
Block a user