Commit Graph

17 Commits

Author SHA1 Message Date
Damien Elmes
7dcbc7efec basic night mode support
Forces the Fusion theme when running night mode, so we don't need
to work around platform themes that don't respond to the defined
palette.

Feedback/suggestions on the chosen colours welcome - _vars.scss is the
file to change if you want to experiment with adjustments.
2020-01-23 17:27:07 +10:00
Damien Elmes
d54f719558 add a webview_did_receive_js_message hook 2020-01-22 11:06:12 +10:00
Damien Elmes
02ec3f149c update qt/ to use the new API 2020-01-20 20:10:38 +10:00
Damien Elmes
02145c7078 fix <br> remaining when image attached to empty field 2020-01-19 16:41:39 +10:00
Damien Elmes
5260e10f8f leave percent-escaped text from the editor alone
Originally added in d7339d9a27b8abd65fbcf85f809fb0089046986f;
unfortunately the change message does not describe why. Images
are handled separately, so it should theoretically not be required,
and keeping it in leads to garbled text when people include %
on their cards.

Latest report at https://anki.tenderapp.com/discussions/ankidesktop/38138-errors-in-conversion-of-latex-and-ea
2020-01-19 16:29:46 +10:00
Damien Elmes
ef8bb61fc3 AnkiRequestsClient -> HttpClient 2020-01-19 11:33:27 +10:00
Damien Elmes
0d1a25eb5b move AnkiRequestsClient into its own file
It should still be accessible via anki.sync as well.
2020-01-18 15:45:14 +10:00
Damien Elmes
4c0b7d37c9 option to invert paste handling in prefs 2020-01-16 12:36:04 +10:00
Damien Elmes
bf93731e49 revert to the old wrap() behaviour
wrap2() was introduced recently to try and resolve an issue where
styling outside of the wrapped section was getting lost. eg,

<b>some [text] etc</b>

When the user created a cloze deletion or added math tags to the [text]
part, the text ended up not being bold - the inner portion is displayed
without styling.

wrap2() used setFormat("inserttext", ...), which did fix that issue
- but it also introduced multiple new issues:

- any HTML inside the selected area, including newlines and images,
was lost
- the unicode entities inserted when creating a cloze deletion in
RTL mode end up inserted as plain text

For now, I'm just going to revert to the old behaviour. If anyone
has a suggestion for an approach that is able to preserve both the
inner formatting and the surrounding formatting, a pull request
or post on the forums would be appreciated!
2020-01-16 10:33:36 +10:00
Damien Elmes
886536d78f fix cases where we used the wrong type sig to connect to gui hook 2020-01-16 07:53:12 +10:00
Damien Elmes
8310cb7a0e add qconnect helper and some type hints
The type hints allow mypy to check the gui_hook calls, revealing a
bunch of places that are broken as they expect no arguments like the
legacy hooks.

To make mypy happy about PyQt's signal.connect(func), a qconnect()
helper has been added.
2020-01-16 07:41:23 +10:00
Damien Elmes
b09e7e8247 more tweaks for readability/consistency 2020-01-15 17:45:35 +10:00
Damien Elmes
237c0791f8 more hook tweaks, and merge the pre-render field and template hooks 2020-01-15 17:18:11 +10:00
Damien Elmes
cab572b63c remove _hook/_filter suffix 2020-01-15 16:53:24 +10:00
Damien Elmes
89fce1f6b7 migrate addHook/remHook calls 2020-01-15 13:49:26 +10:00
Damien Elmes
660685375f migrate most of the remaining runHook() calls 2020-01-15 12:46:53 +10:00
Damien Elmes
5876866565 tweaking the folder names again
hopefully that's the last of it
2020-01-03 07:48:38 +10:00