Commit graph

195 commits

Author SHA1 Message Date
RumovZ
54d39d1b3b Live theme changes (#1497)
* Allow theme change at runtime and add hook

* Save or restore default palette on theme change

* Update aqt widget styles on theme change

* styling fixes

- drop _light_palette, as default_palette serves the same purpose
- save default platform theme, and restore it when switching away
from nightmode
- update macOS light/dark mode on theme switch
- fix unreadable menus on Windows

* update night-mode classes on theme change

This is the easy part - CSS styling that uses standard_css or our
css variables should update automatically. The main remaining issue
is JS code that sets colors based on the theme at the time it's run -
eg the graph code, and the editor.

* switch night mode value on toggle

* expose current theme via a store; switch graphs to use it

https://github.com/ankitects/anki/issues/1471#issuecomment-972402492

* start using currentTheme in editor/components

This fixes basic editing - there are still components that need updating.

* add simple xcodeproj for code completion

* add helper to get currently-active system theme on macOS

* fix setCurrentTheme not being immediately available

* live update tag color

* style().name() doesn't work on Qt5

* automatic theme switching on Windows/Mac

* currentTheme -> pageTheme

* Replace `nightModeKey` with `pageTheme`

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2021-11-25 07:17:41 +10:00
Damien Elmes
55056baf28 run ftl/remove-unused.sh 2021-11-24 14:44:02 +10:00
Damien Elmes
a705b72c46 retire the v1 scheduler 2021-11-24 14:12:56 +10:00
Matthias Metelka
e2a30666e4 Change Notetype UI Rework (#1499)
* Enable access to old notetype name

* Set minimum height for ChangeNotetypeDialog

* Add bootstrap icons to change-notetype

* Move alert up and make it collapsible

* Tweak some CSS

- Add variables --sticky-bg and --sticky-border to StickyContainer
- Tweak base.css

* Add translatable string "(Nothing)"

* Rework ChangeNotetype screen

* Initially load option at newIndex and remaining options on focus

Optimization for big notetypes:
Should increase efficiency from O(n²) to O(n). Test on notetype with 500 templates shows significant improvement in load time (~10s down to ~1s).

* Try to satisfy rust test

* Change arrow direction depending on reading direction

+ add 0.5em top padding to main

* Create Alert.svelte

* Introduce CSS variable --pane-bg

* Revert "Initially load option at newIndex and remaining options on focus"

This reverts commit f42beee45c.

* Final cleanup

* Refine padding/gutter
2021-11-24 12:09:55 +10:00
Damien Elmes
8acc482848 drop beta tag from v3 scheduler
Will exit beta when 2.1.50 is released as stable
2021-11-23 11:10:04 +10:00
Henrik Giesel
0f17c32401 Mathjax editor improvements (#1502)
* Remove unnecessary stopPropagation of mathjax-overlay events

* Use CodeMirror component for MathjaxHandle

* Refactor ResizeObserver code in MathjaxHandle

* Wrap setRange in CodeMirror in try/catch

* Add Mathjax Editor bottom margin

* Add custom Enter and Shift+Enter shortcuts for the MathjaxHandle

* Format

* Move placeCaretAfter to domlib

* Move focus back to field after editing Mathjax

* Put Cursor after Mathjax after accepting

* Add delete button for Mathjax

* Change border color of mathjax menu

* Refactor into MathjaxMenu

* Put caretKeyword in variable

* Use one ResizeObserver for all Mathjax images

* Add minmimum width for Mathjax editor

* is still smaller than minimal window width

* Add bazel directories to .prettierignore and format from root

* exclude ftl/usage (dae)

the json files that live there are output from our tooling, and
formatting them means an extra step each time we want to update them

also exclude .mypy_cache, which is output by scripts/mypy*

* minor ftl tweak: newline -> new line  (dae)
2021-11-23 10:27:32 +10:00
Matthias Metelka
1592fd0295 Editor Field Descriptions (#1476)
* Add description input to fields dialog

QLineEdit seems like the best option, as it saves space and motivates users to keep their descriptions concise.

* Add setDescriptions to note initialization script

Went for the extra function instead of including it in setFields to prevent potential add-on breakages.

* Add tooltip next to field name if description is set

* Refactor code according to suggestions

Set default tooltip placement to right instead of bottom

Use .get() for fld["description"]

Fix tab order in fields dialog

Swap out abbreviation "desc" for full length name to keep consistency

* Update Protobuf and Rust for description

Add description to notetypes.proto and schema11

Co-authored-by: RumovZ <RumovZ@users.noreply.github.com>

* Fix tooltips not updating with description

Remove redundant variable tooltipOptions

Update previousTooltip within reactive function

* Move LabelDescription out of LabelName

Co-authored-by: Henrik Giesel <hgiesel@users.noreply.github.com>

* Decrease icon size and fix alignment

Co-Authored-By: Henrik Giesel <hengiesel@gmail.com>

* the new key needs to be cleared from fields, not the notetype itself

Co-authored-by: RumovZ <RumovZ@users.noreply.github.com>
Co-authored-by: Henrik Giesel <hengiesel@gmail.com>
Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2021-11-06 09:42:48 +10:00
RumovZ
51874bc612 Do not bury suspended cards (#1447)
* Skip burying for suspended cards

* Inform about number of buried cards
2021-10-23 11:04:26 +10:00
RumovZ
847bf3fe12 Move update logic into CardInfo.svelte 2021-10-18 09:01:24 +02:00
RumovZ
7570a0757e Make window titles more user-friendly 2021-10-18 09:01:23 +02:00
RumovZ
3b5f4413f8 Use updating card infos in browser and reviewer 2021-10-18 09:01:23 +02:00
Damien Elmes
181bfab3d9 Merge pull request #1397 from RumovZ/column-tooltips
Add tooltips for some browser columns
2021-10-01 19:12:59 +10:00
Damien Elmes
1b4d3a9047 "number of cards a note has" 2021-10-01 19:12:49 +10:00
RumovZ
0d68e1d59c Add tooltips for some browser columns 2021-09-30 13:15:09 +02:00
RumovZ
b42379bf96 Apply suggestions from code review
Capitalise "selected"

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2021-09-22 16:59:05 +02:00
RumovZ
dcb7d44ce4 Enable adding/removing tags from the sidebar ...
... to selected notes.
2021-09-21 11:48:43 +02:00
Damien Elmes
2c235ccc70 don't check state of current card when repositioning
closes #1365
2021-09-13 14:56:53 +10:00
Damien Elmes
d6552cf14e Merge pull request #1358 from evandroforks/lastcardinfo
Add option to reveal previous card's info
2021-09-13 12:06:10 +10:00
Damien Elmes
f9e27fcefb tweak sync conflict message 2021-09-08 19:19:23 +10:00
evandrocoan
3c5514d12f Fix #1355 2021-09-07 23:53:47 -03:00
Henrik Giesel
427a49e036 Adjust actual size tooltip 2021-09-06 21:15:36 +10:00
Henrik Giesel
7696a181f3 Implement Maximum image size mechanism 2021-09-06 21:15:36 +10:00
Henrik Giesel
a6b071d849 Add float tooltips 2021-09-06 21:15:36 +10:00
Damien Elmes
7f03ecb202 Merge pull request #1337 from Arthur-Milchior/main
Mention .anki can be imported with add-on 175027074
2021-08-24 11:04:33 +10:00
Damien Elmes
21c2fe7b2d add note about interday learning cards being fetched preferentially
+ priority->order
2021-08-22 15:32:46 +10:00
Damien Elmes
0aae073056 adding options to sort by ascending/descending ease 2021-08-22 15:32:46 +10:00
Arthur Milchior
b1da25d112 Mention .anki can be imported with add-on 175027074 2021-08-21 15:25:04 +02:00
Damien Elmes
104a24bc1d add options to v3 to preserve new card gather order
Allows cards to be presented in deck order when gather priority is set
to 'deck'.
2021-08-20 12:03:32 +10:00
Damien Elmes
6410e66857 filtered decks w/ scheduling disabled in v3 now log reviews 2021-08-19 20:25:29 +10:00
Damien Elmes
37ed7f9bae fix inverted 'skip question when replaying answer' option
I'd intended to add a new string but overlooked it.

https://forums.ankiweb.net/t/bug-always-include-question-side-when-replaying-audio/12273/2
2021-08-15 16:15:14 +10:00
Henrik Giesel
00b990b79e Add tooltip for Toggly sticky icon 2021-08-03 06:02:29 +02:00
Henrik Giesel
78f3aff987 Rename to text color and text color highlight 2021-07-26 05:28:28 +02:00
Damien Elmes
e43f2b23cc clarify deck description message
+ drop the reference to overview screen
2021-07-24 21:45:09 +10:00
Damien Elmes
39b2f5d82f handle notes with missing cards in browser
https://forums.ankiweb.net/t/2-1-45-release-candidate/11362/30
2021-07-22 14:58:57 +10:00
Damien Elmes
eb4e18a45f Merge pull request #1293 from RumovZ/find-and-replace
Find & Replace
2021-07-16 10:47:16 +10:00
RumovZ
4f17400021 Add sidebar actions
- Find & Replace for notetype fields
- Rename with Parents for decks and tags
2021-07-13 16:34:02 +02:00
RumovZ
4b1218184d Rework Find & Replace dialog:
- Add option to affect whole collection
- Allow to open without selection
- Add parameter for presetting field
2021-07-13 16:33:45 +02:00
Damien Elmes
527ad0a3da ascending/descending position
https://forums.ankiweb.net/t/anki-2-1-45-beta/10664/131
2021-07-13 16:10:29 +10:00
Damien Elmes
1d4fb0ca50 add note about display order using current deck 2021-07-13 15:58:06 +10:00
Damien Elmes
33a9afaa1b add back in missing check for upload size
Compression now happens up-front, so we can tell in advance if the
upload size has been exceeded.
2021-06-29 10:50:03 +10:00
Damien Elmes
b959feb6e5 expose scheduler js option in deck config 2021-06-24 14:38:10 +10:00
Damien Elmes
4ffca62afe allow customization of default search text
https://forums.ankiweb.net/t/whats-the-default-search-when-browsing-now-also-how-do-i-choose-to-browse-current-deck/8922
2021-06-24 11:24:30 +10:00
RumovZ
9ae6df9b88 Make missing cloze a warning again 2021-06-15 08:43:00 +02:00
RumovZ
4242754833 Remove desktop-specific 'Cards...' hint 2021-06-15 08:42:43 +02:00
RumovZ
46ee710a06 Check for out-of-place/missing clozes when adding 2021-06-12 10:05:42 +02:00
Damien Elmes
153e1e8d41 new change notetype implementation for the frontend
- changes can now be undone
- the same field can now be mapped to multiple target fields, allowing
fields to be cloned
- the old Qt dialog has been removed
- the old col.models.change() API calls the new code, to avoid
breaking existing consumers. It requires the field map to always
be passed in, but that appears to have been the common case.
- closes #1175
2021-06-10 22:19:24 +10:00
Damien Elmes
7f984851b4 add notetype changing to backend 2021-06-09 20:56:52 +10:00
Damien Elmes
1edb044510 add Card Info action translation 2021-06-08 14:07:13 +10:00
Damien Elmes
95151f5025 add LIFO sorting options for new cards 2021-06-08 14:01:46 +10:00
Damien Elmes
998a3c0f7f add Rescheduled to Today section of sidebar
https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/105
2021-06-05 12:55:07 +10:00