Don't disable animations on card templates when reduce motion is on

We may wish to revisit this decision in the future, once we no longer
enable reduce motion by default to prevent the toolbar redraw bugs.

Closes #2499
This commit is contained in:
Damien Elmes 2023-05-17 16:45:57 +10:00
parent 25cd181c9f
commit c54b897b4f

View file

@ -156,7 +156,7 @@ class ThemeManager:
return cache.setdefault(path, icon) return cache.setdefault(path, icon)
def body_class(self, night_mode: bool | None = None) -> str: def body_class(self, night_mode: bool | None = None, reviewer: bool = False) -> str:
"Returns space-separated class list for platform/theme/global settings." "Returns space-separated class list for platform/theme/global settings."
classes = [] classes = []
if is_win: if is_win:
@ -172,7 +172,7 @@ class ThemeManager:
classes.extend(["nightMode", "night_mode"]) classes.extend(["nightMode", "night_mode"])
if self.macos_dark_mode(): if self.macos_dark_mode():
classes.append("macos-dark-mode") classes.append("macos-dark-mode")
if aqt.mw.pm.reduce_motion(): if aqt.mw.pm.reduce_motion() and not reviewer:
classes.append("reduce-motion") classes.append("reduce-motion")
if not aqt.mw.pm.minimalist_mode(): if not aqt.mw.pm.minimalist_mode():
classes.append("fancy") classes.append("fancy")
@ -184,7 +184,7 @@ class ThemeManager:
self, card_ord: int, night_mode: bool | None = None self, card_ord: int, night_mode: bool | None = None
) -> str: ) -> str:
"Returns body classes used when showing a card." "Returns body classes used when showing a card."
return f"card card{card_ord+1} {self.body_class(night_mode)}" return f"card card{card_ord+1} {self.body_class(night_mode, reviewer=True)}"
def var(self, vars: dict[str, str]) -> str: def var(self, vars: dict[str, str]) -> str:
"""Given day/night colors/props, return the correct one for the current theme.""" """Given day/night colors/props, return the correct one for the current theme."""