* Prevent multiple inclusion of variables in CSS files
* Use dict instead of tuple for variables
* Add comments to variables
* Improve appearance of main window
* Tweak main window styles
* Use json.dumps over pprint.format
* Make study button primary
* Improve header margin
* Make bottom toolbar slimmer
* Make congrats page more balanced
* Fix type issue
* Replace day/night with light/dark
* Exclude top-level-drag-row from hover effect
* Create dataclass for variables
* Run formatter
* Apply CSS variables from Python side
Why go full-circle with the Sass variables? This way we only need one interface for add-on authors to interact with. It also makes it easier for us to apply additional themes in the future.
* Fix typing
* Fix rgba values in Qt
* Darken button background
* Fix palette not being applied in light theme
For some odd reason this problem arose much later than #2016.
* Tweak default button look
* Reformat
* Apply CSS vars to ts pages
* Include elevation in button_mixins_lib
* Cast opacity to int
* Add some margin to studiedToday info
* Tweak light theme button gradient
* Tweak highlight-bg for light theme
* Add back default button color
as it made the browser sidebar tool icons dark in light theme.
* Reformat
* Tweak light theme buttons once more
Sorry for the back-and-forth. Sass only compiles when there are changes in user files, not when I only change the vars.
* Fix bottom toolbar button indicators
* Make buttons more clicky
* Fix button padding
* Handle macOS separately again
* Decrease elevation effect for main window buttons to 1
* Imitate box-shadow for Qt elements
* Adjust shadow vars
* Adjust primary border color
because the save button in the deck options had a lighter color than its background gradient.
* Boost box-shadow color of primary buttons
* Format
* Adjust Qt box-shadow imitation and shadow colors
* Use more subtle default shadow color
* Add some more padding to top toolbar
* Revert "Apply CSS vars to ts pages"
This reverts commit 5d8e7f6b7ffc8894b6517ecbb8cfba35407fc69a.
* Revert "Apply CSS variables from Python side"
This reverts commit 87db774412fd2bfd75e2630d2c5e782daef96b5f.
* Better match the standard macOS buttons
In the dark theme the standard color is a lighter grey, but at least
the size/shape is similar again.
This doesn't work for the editor buttons.
* Reduce the top margin of the congrats screen
* Fix illegible buttons when changing theme on macOS; match dark button style
* Enable state-dependent custom scheduling data
* Next(Card)States -> SchedulingStates
The fact that `current` was included in `next` always bothered me,
and custom data is part of the card state, so that was a bit confusing
too.
* Store custom_data in SchedulingState
* Make custom_data optional when answering
Avoids having to send it 4 extra times to the frontend, and avoids the
legacy answerCard() API clobbering the stored data.
Co-authored-by: Damien Elmes <gpg@ankiweb.net>
* Add card meta for persisting custom scheduling state
* Rename meta -> custom_data
* Enforce limits on size of custom data
Large values will slow down table scans of the cards table, and it's
easier to be strict now and possibly relax things in the future than
the opposite.
* Pack card states and customData into a single message
+ default customData to empty if it can't be parsed
Co-authored-by: Damien Elmes <gpg@ankiweb.net>
Partially completes #1068, and will allow mobile clients to drop
their separate diff-match-patch imports. Does not yet try to handle
case folding or combining-char stripping, and leaves some of the outer
HTML wrapping up to the frontend for now.
The logic for rendering the provided string has changed: missing chars
are now only inserted if they follow a correct section, and the original
text is shown instead of hyphens. This is an experiment, and can be
changed if it's not well received.
* Allow webviews to opt in to default D&D handling
* Remove redundant webview.js include
* Block default drag & drop behavior in reviewing screens
* Fix mypy error
* Add forget prompt with options
- Restore original position
- Reset reps and lapses
* Restore position when resetting for export
* Add config context to avoid passing keys
* Add routine to fetch defaults; use method-specific enum (dae)
* Keep original position by default (dae)
* Fix code completion for forget dialog (dae)
Needs to be a symbolic link to the generated file
The previous change in 1871b57663 failed
to consider the browser refreshing case, as reported here:
https://forums.ankiweb.net/t/anki-2-1-50-beta-3-4/17501/30
I previously attempted to solve this by having SetFlag skip the queue
rebuild, then mutating the captured mtimes in the queues. That didn't
work correctly when undoing, as the queue mutations weren't recorded.
This approach combines that attempt and the previous change: flag
setting is an undoable operation again, but does not change the card's
modification time, so it can be applied/undone without a queue build
being required. Instead of special-casing flag changes in the review
screen, we now just redraw the flag on changes.card, as any other card
op will have triggered a queue rebuild.
* Call StudyDeck with callback
* StudyDeck w/ callback, remove redundant assignment
* Replace exec() with show() for various dialogs
* Update super init args for Models.__init__
* Make StudyDialog ApplicationModal
* Remove .exec() from various dialogs and menus
* Use submodule imports in aqt
* Use submodule imports in pylib
* More submodule imports in pylib
These required removing some direct imports to get rid of import cycles.
We want to preserve the backend checks, because they may also detect
bugs. So we do the debouncing on the frontend instead, transitioning
into a temporary state until the background op completes.
https://forums.ankiweb.net/t/anki-2-1-50-beta/15608/74
* PEP8 dbproxy.py
* PEP8 errors.py
* PEP8 httpclient.py
* PEP8 lang.py
* PEP8 latex.py
* Add decorator to deprectate key words
* Make replacement for deprecated attribute optional
* Use new helper `_print_replacement_warning()`
* PEP8 media.py
* PEP8 rsbackend.py
* PEP8 sound.py
* PEP8 stdmodels.py
* PEP8 storage.py
* PEP8 sync.py
* PEP8 tags.py
* PEP8 template.py
* PEP8 types.py
* Fix DeprecatedNamesMixinForModule
The class methods need to be overridden with instance methods, so every
module has its own dicts.
* Use `# pylint: disable=invalid-name` instead of id
* PEP8 utils.py
* Only decorate `__getattr__` with `@no_type_check`
* Fix mypy issue with snakecase
Importing it from `anki._vendor` raises attribute errors.
* Format
* Remove inheritance of DeprecatedNamesMixin
There's almost no shared code now and overriding classmethods with
instance methods raises mypy issues.
* Fix traceback frames of deprecation warnings
* remove fn/TimedLog (dae)
Neither Anki nor add-ons appear to have been using it
* fix some issues with stringcase use (dae)
- the wheel was depending on the PyPI version instead of our vendored
version
- _vendor:stringcase should not have been listed in the anki py_library.
We already include the sources in py_srcs, and need to refer to them
directly. By listing _vendor:stringcase as well, we were making a
top-level stringcase library available, which would have only worked for
distributing because the wheel definition was also incorrect.
- mypy errors are what caused me to mistakenly add the above - they
were because the type: ignore at the top of stringcase.py was causing
mypy to completely ignore the file, so it was not aware of any attributes
it contained.
The enum changes should work on PyQt 5.x, and are required in PyQt 6.x.
They are not supported by the PyQt5 typings however, so we need to run
our tests with PyQt6.
This reverts commit 54f51da944.
This breaks in the PyQt6 upgrade. There are no globals anymore, only
page profiles - but the code should probably be modifying a specific
webview instead of globals anyway.
This adds Python 3.9 and 3.10 typing syntax to files that import
attributions from __future___. Python 3.9 should be able to cope with
the 3.10 syntax, but Python 3.8 will no longer work.
On Windows/Mac, install the latest Python 3.9 version from python.org.
There are currently no orjson wheels for Python 3.10 on Windows/Mac,
which will break the build unless you have Rust installed separately.
On Linux, modern distros should have Python 3.9 available already. If
you're on an older distro, you'll need to build Python from source first.
easily confuse a user that Ctrl+i is for the current card.
Ctrl was first added because it is easier to press,
at least for me, then, I press first using Ctrl and if
not available go to Alt.