mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Refactoring and comments (#3721)
This commit is contained in:
parent
d0a4fbb7aa
commit
db30685b9a
2 changed files with 10 additions and 2 deletions
|
@ -800,15 +800,20 @@ class AnkiQt(QMainWindow):
|
|||
def _reviewState(self, oldState: MainWindowState) -> None:
|
||||
self.reviewer.show()
|
||||
|
||||
if self.fullscreen:
|
||||
self.hide_menubar()
|
||||
fullscreen_was_checked = False
|
||||
|
||||
if self.pm.hide_top_bar():
|
||||
self.toolbarWeb.hide_timer.setInterval(500)
|
||||
self.toolbarWeb.hide_timer.start()
|
||||
|
||||
# check the `hide_if_allowed` method in `qt/aqt/toolbar.py`
|
||||
fullscreen_was_checked = True
|
||||
else:
|
||||
self.toolbarWeb.flatten()
|
||||
|
||||
if not fullscreen_was_checked and self.fullscreen:
|
||||
self.hide_menubar()
|
||||
|
||||
if self.pm.hide_bottom_bar():
|
||||
self.bottomWeb.hide_timer.setInterval(500)
|
||||
self.bottomWeb.hide_timer.start()
|
||||
|
|
|
@ -98,6 +98,9 @@ class TopWebView(ToolbarWebView):
|
|||
if self.mw.state != "review":
|
||||
return
|
||||
|
||||
# Invariant: The `hide_if_allowed` method ensures that the fullscreen state is checked
|
||||
# and the menubar will be hidden if necessary
|
||||
# Note: The `eventFilter` and `_reviewState` methods in `qt/aqt/main.py` rely on this invariant
|
||||
if self.mw.fullscreen:
|
||||
self.mw.hide_menubar()
|
||||
|
||||
|
|
Loading…
Reference in a new issue