If the parameter given to setSizes is very small and smaller than QSplitter, the sub windows within QSplitter will be stretched. It is advisable to set a larger parameter for setSizes as much as possible.
Due to Anki not providing a hook when closing the editor, refactoring to use set filter to check which editors are not active and avoid creating a large number of hooks. By traversing the set, it is determined whether the current editor needs to be refreshed.
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.
Previewer-specific styles can now be specified in card templates by
targeting the "editor-preview" class. E.g:
```
.editor-preview {
font-size: 12px;
}
```
Closes#1
This utilizes Anki's theme_manager to determine if the default light version of a card should be used in the Editor Live Preview or if the night mode version should be used.
Anki 2.1.44 and prior used a different set of javascript in the
reviewer. There is no easy way to obtain those programmatically, so this
is a crude fix.
Fixes#2
Signed-off-by: Tobias Manske <tobias.manske@mailbox.org>