mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
Fix: Bottom bar remains for windows
This commit is contained in:
parent
b80468554a
commit
42325fd548
2 changed files with 9 additions and 6 deletions
|
|
@ -1275,7 +1275,7 @@ class SvelteReviewer(Reviewer):
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
idx, counts = self._v3.counts()
|
idx, counts = self._v3.counts()
|
||||||
self.bottom.web.eval(f"_updateRemaining({json.dumps(counts)},{idx})")
|
self.web.eval(f"_updateRemaining({json.dumps(counts)},{idx})")
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def _showAnswerButton(self) -> None:
|
def _showAnswerButton(self) -> None:
|
||||||
|
|
@ -1284,7 +1284,7 @@ class SvelteReviewer(Reviewer):
|
||||||
else:
|
else:
|
||||||
maxTime = 0
|
maxTime = 0
|
||||||
self._remaining()
|
self._remaining()
|
||||||
self.bottom.web.eval('showQuestion("",%d);' % (maxTime))
|
self.web.eval('showQuestion("",%d);' % (maxTime))
|
||||||
|
|
||||||
def _buttonTime(self, i: int, v3_labels: Sequence[str]) -> str:
|
def _buttonTime(self, i: int, v3_labels: Sequence[str]) -> str:
|
||||||
return v3_labels[i - 1] if self.mw.col.conf["estTimes"] else ""
|
return v3_labels[i - 1] if self.mw.col.conf["estTimes"] else ""
|
||||||
|
|
@ -1298,14 +1298,13 @@ class SvelteReviewer(Reviewer):
|
||||||
|
|
||||||
def _initWeb(self) -> None:
|
def _initWeb(self) -> None:
|
||||||
self._reps = 0
|
self._reps = 0
|
||||||
|
# hide the bottom bar
|
||||||
|
self.bottom.web.setHtml("<style>body {margin:0;} html {height:0;}</style>")
|
||||||
# main window
|
# main window
|
||||||
self.web.load_sveltekit_page("reviewer")
|
self.web.load_sveltekit_page("reviewer")
|
||||||
# block default drag & drop behavior while allowing drop events to be received by JS handlers
|
# block default drag & drop behavior while allowing drop events to be received by JS handlers
|
||||||
self.web.allow_drops = True
|
self.web.allow_drops = True
|
||||||
self.web.eval("_blockDefaultDragDropBehavior();")
|
self.web.eval("_blockDefaultDragDropBehavior();")
|
||||||
# ensure bottom web functions trigger
|
|
||||||
self.bottom.web = self.web
|
|
||||||
self.mw.bottomWeb.hide()
|
|
||||||
|
|
||||||
def _shortcutKeys(self) -> Sequence[tuple[str, Callable] | tuple[Qt.Key, Callable]]:
|
def _shortcutKeys(self) -> Sequence[tuple[str, Callable] | tuple[Qt.Key, Callable]]:
|
||||||
return []
|
return []
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,11 @@ class BottomWebView(ToolbarWebView):
|
||||||
def animate_height(self, height: int) -> None:
|
def animate_height(self, height: int) -> None:
|
||||||
self.web_height = height
|
self.web_height = height
|
||||||
|
|
||||||
if self.mw.pm.reduce_motion() or height == self.height():
|
if (
|
||||||
|
self.mw.pm.reduce_motion()
|
||||||
|
or self.mw.col.conf.get("newReviewer")
|
||||||
|
or height == self.height()
|
||||||
|
):
|
||||||
self.setFixedHeight(height)
|
self.setFixedHeight(height)
|
||||||
else:
|
else:
|
||||||
# Collapse/Expand animation
|
# Collapse/Expand animation
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue