From 258a10edc760839201951653511e6dc8269e4109 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 7 Jul 2016 17:23:13 +1000 Subject: [PATCH] add titles to various webviews to make them easy to locate --- aqt/editor.py | 1 + aqt/main.py | 6 +++--- aqt/webview.py | 7 ++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/aqt/editor.py b/aqt/editor.py index 8687f66bb..2f3158311 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -344,6 +344,7 @@ class Editor(object): def setupWeb(self): self.web = EditorWebView(self.widget, self) + self.web.title = "editor" self.web.allowDrops = True self.web.onBridgeCmd = self.onBridgeCmd self.outerLayout.addWidget(self.web, 1) diff --git a/aqt/main.py b/aqt/main.py index e6a08b596..44dc23486 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -501,18 +501,18 @@ title="%s" %s>%s''' % ( self.form.setupUi(self) # toolbar tweb = aqt.webview.AnkiWebView() - tweb.setObjectName("toolbarWeb") + tweb.title = "top toolbar" tweb.setFocusPolicy(Qt.WheelFocus) self.toolbar = aqt.toolbar.Toolbar(self, tweb) self.toolbar.draw() # main area self.web = aqt.webview.AnkiWebView() - self.web.setObjectName("mainText") + self.web.title = "main webview" self.web.setFocusPolicy(Qt.WheelFocus) self.web.setMinimumWidth(400) # bottom area sweb = self.bottomWeb = aqt.webview.AnkiWebView() - sweb.setObjectName("bottomWeb") + sweb.title = "bottom toolbar" sweb.setFocusPolicy(Qt.WheelFocus) # add in a layout self.mainLayout = QVBoxLayout() diff --git a/aqt/webview.py b/aqt/webview.py index 97168130d..33285f244 100644 --- a/aqt/webview.py +++ b/aqt/webview.py @@ -69,7 +69,7 @@ class AnkiWebView(QWebEngineView): def __init__(self, canFocus=True): QWebEngineView.__init__(self) - self.setObjectName("mainText") + self.title = "default" self._page = AnkiWebPage(self._onBridgeCmd) self._loadFinishedCB = None @@ -142,7 +142,7 @@ class AnkiWebView(QWebEngineView): def stdHtml(self, body, css="", bodyClass="", js=None, head=""): self.setHtml(""" -