From 5e3f35a32cad079ff60e759ffd1e31e1728a369b Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 25 Oct 2018 15:34:27 +1000 Subject: [PATCH] workaround bottom toolbar issue on macOS/qt5.12 --- aqt/webview.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aqt/webview.py b/aqt/webview.py index ca4e18191..467031609 100644 --- a/aqt/webview.py +++ b/aqt/webview.py @@ -352,7 +352,11 @@ body {{ zoom: {}; {} }} self.onBridgeCmd = self.defaultOnBridgeCmd def adjustHeightToFit(self): - self.evalWithCallback("$(document.body).height()", self._onHeight) + from aqt import mw + # fixes bottom toolbar intermittently breaking on startup + def delayedResize(qvar): + mw.progress.timer(10, lambda: self._onHeight(qvar), False) + self.evalWithCallback("$(document.body).height()", delayedResize) def _onHeight(self, qvar): if qvar is None: