Anki/qt/aqt
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
..
browser Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
data Fix issue 1362 and add a default favicon.ico (#1369) 2021-11-23 12:18:32 +10:00
forms Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
operations switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
qt avoid printing compat warning on Qt5 2021-10-29 19:29:12 +10:00
__init__.py ignore requested graphics driver on Qt6 for now 2021-10-29 19:34:05 +10:00
about.py PEP8 for rest of pylib (#1451) 2021-10-25 14:50:13 +10:00
addcards.py Fix close button for add cards dialog (#1496) 2021-11-18 07:22:23 +10:00
addons.py Add hotkey to save add-on config (#1492) 2021-11-17 07:18:48 +10:00
BUILD.bazel improve PyQt install 2021-10-23 10:56:17 +10:00
changenotetype.py Change Notetype UI Rework (#1499) 2021-11-24 12:09:55 +10:00
clayout.py Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
colors.py move remaining Filter button items into sidebar 2021-02-05 18:58:22 +10:00
customstudy.py PEP8 pylib (#1443) 2021-10-22 20:39:49 +10:00
dbcheck.py PEP8 collection.py 2021-06-27 15:12:22 +10:00
deckbrowser.py retire the v1 scheduler 2021-11-24 14:12:56 +10:00
deckchooser.py Fix chooser label not being updated when current notetype/deck renamed (#1452) 2021-10-25 13:23:06 +10:00
deckconf.py PEP8 pylib (#1443) 2021-10-22 20:39:49 +10:00
deckdescription.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
deckoptions.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
editcurrent.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
editor.py Editor Field Descriptions (#1476) 2021-11-06 09:42:48 +10:00
emptycards.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
errors.py catch all recording errors; mention permission 2021-06-02 12:20:40 +10:00
exporting.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
fields.py Editor Field Descriptions (#1476) 2021-11-06 09:42:48 +10:00
filtered_deck.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
flags.py use Qt search path instead of resource system 2021-10-12 16:17:08 +10:00
gui_hooks.py fix qt/ pylints 2021-01-07 16:21:50 +10:00
hooks_gen.py symlink generated .py/.pyi into tree to fix Python code completion 2020-12-16 11:36:42 +10:00
importing.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
legacy.py run pyupgrade over codebase [python upgrade required] 2021-10-04 15:05:48 +10:00
main.py Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
mediacheck.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
mediasrv.py minor wording tweaks and a docstring 2021-11-23 12:18:50 +10:00
mediasync.py PEP8 for rest of pylib (#1451) 2021-10-25 14:50:13 +10:00
modelchooser.py run pyupgrade over codebase [python upgrade required] 2021-10-04 15:05:48 +10:00
models.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
mpv.py run pyupgrade over codebase [python upgrade required] 2021-10-04 15:05:48 +10:00
notetypechooser.py Remove all_names in notetypechooser (#1501) 2021-11-23 10:27:57 +10:00
overview.py PEP8 pylib (#1443) 2021-10-22 20:39:49 +10:00
package.py ignore a spurious mypy error 2021-10-28 19:19:37 +10:00
pinnedmodules.py drop PyAudio support 2021-10-15 13:15:16 +10:00
platform.py Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
preferences.py Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
profiles.py Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
progress.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
py.typed mark anki and aqt modules as having typing info 2020-01-13 13:03:37 +10:00
reviewer.py change previous card info shortcut 2021-11-24 15:44:25 +10:00
schema_change_tracker.py add a bunch of return types 2021-02-01 23:53:23 +10:00
sound.py fix broken startup on macOS due to incorrect mpv path 2021-10-30 09:14:43 +10:00
stats.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
studydeck.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
switch.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
sync.py PEP8 for rest of pylib (#1451) 2021-10-25 14:50:13 +10:00
tagedit.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
taglimit.py PEP8 for rest of pylib (#1451) 2021-10-25 14:50:13 +10:00
taskman.py avoid importing directly from PyQt5 where possible 2021-10-15 10:47:53 +10:00
theme.py Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
toolbar.py run pyupgrade over codebase [python upgrade required] 2021-10-04 15:05:48 +10:00
tts.py run pyupgrade over codebase [python upgrade required] 2021-10-04 15:05:48 +10:00
undo.py fix redo menu item showing undo text 2021-08-04 10:28:45 +10:00
update.py PEP8 for rest of pylib (#1451) 2021-10-25 14:50:13 +10:00
utils.py updated package scripts 2021-10-28 18:46:45 +10:00
webview.py Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
wheel_description.txt move aqt_data into source folder; implement wheel building 2020-11-04 12:14:03 +10:00
winpaths.py run pyupgrade over codebase [python upgrade required] 2021-10-04 15:05:48 +10:00