factor in user scale factor when calculating height

fixes top bar line not appearing, and possible fix for
https://anki.tenderapp.com/discussions/beta-testing/1685-black-bars
This commit is contained in:
Damien Elmes 2019-12-24 20:15:47 +10:00
parent c4dc40d0db
commit 06e917f80b

View file

@ -416,11 +416,15 @@ body {{ zoom: {}; background: {}; {} }}
self.evalWithCallback("$(document.body).height()", self._onHeight) self.evalWithCallback("$(document.body).height()", self._onHeight)
def _onHeight(self, qvar): def _onHeight(self, qvar):
from aqt import mw
if qvar is None: if qvar is None:
from aqt import mw
mw.progress.timer(1000, mw.reset, False) mw.progress.timer(1000, mw.reset, False)
return return
height = math.ceil(qvar * self.zoomFactor()) scaleFactor = self.zoomFactor()
if scaleFactor == 1:
scaleFactor = mw.pm.uiScale()
height = math.ceil(qvar * scaleFactor)
self.setFixedHeight(height) self.setFixedHeight(height)