anki/ts/editor
RumovZ f2173fddb0
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
..
image-overlay fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
mathjax-overlay Mathjax editor improvements (#1502) 2021-11-23 10:27:32 +10:00
AddonButtons.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
AddTagBadge.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
AutocompleteItem.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
BoldButton.svelte Fix some issues with new surround buttons (#1505) 2021-11-24 10:33:14 +10:00
BUILD.bazel Reverse-engineer surrounding with execCommand (#1377) 2021-11-18 19:18:39 +10:00
change-timer.ts Add ChangeTimer.prototype.fireImmediately 2021-09-16 14:47:05 +02:00
ClozeButton.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
code-mirror.ts Mathjax editor improvements (#1502) 2021-11-23 10:27:32 +10:00
CodeMirror.svelte Mathjax editor improvements (#1502) 2021-11-23 10:27:32 +10:00
ColorButtons.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
CommandIconButton.svelte Reverse-engineer surrounding with execCommand (#1377) 2021-11-18 19:18:39 +10:00
Components.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
CustomStyles.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
DecoratedElements.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
destroyable.ts Fix Cloze button (#1504) 2021-11-24 10:25:24 +10:00
EditingArea.svelte Several editor fixes (#1478) 2021-11-05 11:29:02 +10:00
editor-base.scss Several CSS fixes - Editor Cleanup (#1470) 2021-10-31 08:29:22 +10:00
EditorField.svelte Editor Field Descriptions (#1476) 2021-11-06 09:42:48 +10:00
EditorToolbar.svelte Introduce our own Container, Row, and Col components (#1495) 2021-11-17 13:49:52 +10:00
Fields.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
FieldsEditor.svelte Svelte Editor hotfixes (#1436) 2021-10-19 08:38:06 +10:00
FieldState.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
FormatBlockButtons.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
FormatInlineButtons.svelte Reverse-engineer surrounding with execCommand (#1377) 2021-11-18 19:18:39 +10:00
HandleBackground.svelte Always correctly update MathjaxHandle position 2021-09-15 17:05:43 +02:00
HandleControl.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
HandleLabel.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
HandleSelection.svelte Always correctly update MathjaxHandle position 2021-09-15 17:05:43 +02:00
helpers.ts Use trailingComma: all setting in .prettierrc (#1435) 2021-10-19 09:06:00 +10:00
icons.ts Editor Field Descriptions (#1476) 2021-11-06 09:42:48 +10:00
index_wrapper.ts Export editor globals under anki namespace 2021-07-06 03:48:33 +02:00
index.ts Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
ItalicButton.svelte Fix some issues with new surround buttons (#1505) 2021-11-24 10:33:14 +10:00
LabelContainer.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
LabelDescription.svelte Editor Field Descriptions (#1476) 2021-11-06 09:42:48 +10:00
LabelName.svelte Editor Field Descriptions (#1476) 2021-11-06 09:42:48 +10:00
legacy.scss Several editor fixes (#1478) 2021-11-05 11:29:02 +10:00
NoteEditor.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
NoteTypeButtons.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
Notification.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
OldEditorAdapter.svelte Editor Field Descriptions (#1476) 2021-11-06 09:42:48 +10:00
PlainTextBadge.svelte Several editor fixes (#1478) 2021-11-05 11:29:02 +10:00
PlainTextInput.svelte Mathjax editor improvements (#1502) 2021-11-23 10:27:32 +10:00
PreviewButton.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
RichTextBadge.svelte Highlight field badges when toggled to non-default state (#1466) 2021-10-31 07:48:37 +10:00
RichTextInput.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
RichTextStyles.svelte Several CSS fixes - Editor Cleanup (#1470) 2021-10-31 08:29:22 +10:00
SelectedTagBadge.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
SetContext.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
StickyBadge.svelte Several editor fixes (#1478) 2021-11-05 11:29:02 +10:00
StyleLink.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
StyleTag.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
surround.ts Fix some issues with new surround buttons (#1505) 2021-11-24 10:33:14 +10:00
Tag.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
TagDeleteBadge.svelte Several CSS fixes - Editor Cleanup (#1470) 2021-10-31 08:29:22 +10:00
TagEditMode.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
TagEditor.svelte Introduce our own Container, Row, and Col components (#1495) 2021-11-17 13:49:52 +10:00
TagInput.svelte Several CSS fixes - Editor Cleanup (#1470) 2021-10-31 08:29:22 +10:00
TagOptionsBadge.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
tags.ts add basic tag completion to backend 2021-09-09 15:38:08 +02:00
TagWithTooltip.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
TemplateButtons.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
tsconfig.json Reverse-engineer surrounding with execCommand (#1377) 2021-11-18 19:18:39 +10:00
UnderlineButton.svelte Fix some issues with new surround buttons (#1505) 2021-11-24 10:33:14 +10:00
WithAutocomplete.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
WithColorHelper.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00