Remove the usage of deprecated function.
mv.pm.night_mode() is deprecated (see
1ed2cce648/qt/aqt/profiles.py (L537)
).
Furthermore, on anki Version 2.1.54, Python 3.9.10 Qt 6.3.1 PyQt 6.3.1, this function returns false, even when the dark mode is set.
This commit is contained in:
parent
58cd3cec42
commit
734f24646e
@ -82,10 +82,7 @@ class EditorPreview(object):
|
|||||||
c = note.ephemeral_card()
|
c = note.ephemeral_card()
|
||||||
a = mw.prepare_card_text_for_display(c.answer())
|
a = mw.prepare_card_text_for_display(c.answer())
|
||||||
a = gui_hooks.card_will_show(a, c, "clayoutAnswer")
|
a = gui_hooks.card_will_show(a, c, "clayoutAnswer")
|
||||||
if theme_manager.night_mode:
|
bodyclass = theme_manager.body_classes_for_card_ord(c.ord, theme_manager.night_mode)
|
||||||
bodyclass = theme_manager.body_classes_for_card_ord(c.ord, mw.pm.night_mode())
|
|
||||||
else:
|
|
||||||
bodyclass = theme_manager.body_classes_for_card_ord(c.ord)
|
|
||||||
bodyclass += " editor-preview"
|
bodyclass += " editor-preview"
|
||||||
|
|
||||||
return f"_showAnswer({json.dumps(a)},'{bodyclass}');"
|
return f"_showAnswer({json.dumps(a)},'{bodyclass}');"
|
||||||
|
Loading…
Reference in New Issue
Block a user