Commit Graph

21 Commits

Author SHA1 Message Date
def0045819 Fix the issue of incorrect JS file names introduced under Anki 23.12.1 2024-03-05 03:47:12 +08:00
6acf2d5bb5 Fix for Anki version 24.04+ 2024-03-01 16:30:31 +08:00
d6034c6dcf Fix for Anki version 24.04+ 2024-03-01 16:19:38 +08:00
65cc6c0b12 Modify the implementation method of "avoiding secondary refresh"
The previous implementation may encounter issues in specific scenarios and could potentially become invalid after Anki updates. Now, the approach has been modified to check whether the note content has been modified, which is a simpler and more understandable method.
2024-02-25 05:11:17 +08:00
8487bb86d0 Increase the setSizes parameter
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.
2024-02-02 09:12:49 +08:00
74d12576cd Fix memory leakage caused by hook not releasing
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.
2024-02-02 08:50:17 +08:00
deca35908a Improve compatibility with other plugins
Wrap a widget on the outer layer of the webview so that other plugins can continue to modify the layout.
2024-02-02 07:28:16 +08:00
2023cea60c Fix second refresh after loading note 2024-02-02 07:10:47 +08:00
766d246f46 fix: use Qt6 enums properly
New Anki version(23.10) dropped compatibility for Qt5: https://forums.ankiweb.net/t/porting-tips-for-anki-23-10/35916#enumerations-6
2023-11-05 13:53:17 +00:00
23f9c0cb68 Patch version check for new versioning scheme
I haven't taken a look at anything in the new version yet.
But that closes #16.
2023-09-25 11:50:44 +02:00
ab68523be6 Merge PR #10 2023-03-24 18:16:25 +01:00
4c966c1f5f Format
Signed-off-by: Tobias Manske <tobias.manske@mailbox.org>
2023-03-24 18:02:28 +01:00
8e2815bc87 Add option to split side-by-side view. Also fixes split ratio handling
Signed-off-by: Tobias Manske <tobias.manske@mailbox.org>
2023-03-24 18:02:25 +01:00
734f24646e 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.
2022-12-14 08:36:12 +01:00
a577e785be removed .DS_Store 2022-10-09 17:21:56 +02:00
ef413c20ee Implemented: config file, default open/close state, default split ratio, toolbar icon 2022-10-09 17:19:37 +02:00
30394c02d5 Allow customizing styles via a custom class
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
2022-10-08 00:22:16 +03:00
b41ac7ae1d Add light mode in addition to night mode
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.
2022-08-03 19:14:08 +02:00
f69933d7bd Add version dependent selection of js for preview.
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>
2021-10-09 06:01:05 +02:00
d4083a9cf0 Add resizing, make preview toggleable 2021-09-14 10:56:36 +02:00
4ce1792e7a Refactor and add assets 2021-09-13 02:17:48 +02:00