mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
work around adjustHeightToFit() crashing on Linux
This commit is contained in:
parent
a57b913450
commit
c668efa4b4
1 changed files with 8 additions and 2 deletions
|
@ -13,7 +13,8 @@ import json
|
||||||
from aqt.qt import *
|
from aqt.qt import *
|
||||||
import anki
|
import anki
|
||||||
import aqt.forms
|
import aqt.forms
|
||||||
from anki.utils import fmtTimeSpan, ids2str, stripHTMLMedia, htmlToTextLine, isWin, intTime, isMac
|
from anki.utils import fmtTimeSpan, ids2str, stripHTMLMedia, htmlToTextLine, isWin, intTime,\
|
||||||
|
isMac, isLin
|
||||||
from aqt.utils import saveGeom, restoreGeom, saveSplitter, restoreSplitter, \
|
from aqt.utils import saveGeom, restoreGeom, saveSplitter, restoreSplitter, \
|
||||||
saveHeader, restoreHeader, saveState, restoreState, applyStyles, getTag, \
|
saveHeader, restoreHeader, saveState, restoreState, applyStyles, getTag, \
|
||||||
showInfo, askUser, tooltip, openHelp, showWarning, shortcut, mungeQA
|
showInfo, askUser, tooltip, openHelp, showWarning, shortcut, mungeQA
|
||||||
|
@ -1798,7 +1799,12 @@ class BrowserToolbar(Toolbar):
|
||||||
self.web.onBridgeCmd = self._linkHandler
|
self.web.onBridgeCmd = self._linkHandler
|
||||||
self.web.stdHtml(self.html(), self.css())
|
self.web.stdHtml(self.html(), self.css())
|
||||||
self.update()
|
self.update()
|
||||||
self.web.adjustHeightToFit()
|
if isLin:
|
||||||
|
# adjust height on a delay to work around a qt crash when
|
||||||
|
# opening the browser
|
||||||
|
self.browser.mw.progress.timer(10, self.web.adjustHeightToFit, False)
|
||||||
|
else:
|
||||||
|
self.web.adjustHeightToFit()
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
for link, enabled in (
|
for link, enabled in (
|
||||||
|
|
Loading…
Reference in a new issue