anki/qt/aqt/forms
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
..
__init___qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
__init__.py run black/isort on Python scripts 2021-04-14 18:22:02 +10:00
about_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
about.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
about.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
addcards_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
addcards.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
addcards.ui Make add cards dialog a main window (#1486) 2021-11-14 11:33:59 +10:00
addfield_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
addfield.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
addfield.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
addmodel_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
addmodel.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
addmodel.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
addonconf_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
addonconf.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
addonconf.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
addons_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
addons.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
addons.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
browser_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
browser.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
browser.ui ctrl+alt+n for forget 2021-08-18 15:32:45 +10:00
browserdisp_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
browserdisp.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
browserdisp.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
browseropts_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
browseropts.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
browseropts.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
build_ui_qt5_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
build_ui_qt5.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
build_ui_qt6_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
build_ui_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
build_ui.py remove a few unnecessary PyQt workarounds 2021-10-24 14:24:35 +10:00
BUILD.bazel improve PyQt install 2021-10-23 10:56:17 +10:00
changemap_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
changemap.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
changemap.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
changemodel_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
changemodel.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
changemodel.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
clayout_top_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
clayout_top.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
clayout_top.ui Increased max visible items from clayout_top.ui (#1425) 2021-10-14 19:36:04 +10:00
compile.bzl build all the UI files in one go 2021-10-16 09:20:20 +10:00
customstudy_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
customstudy.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
customstudy.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
dconf_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
dconf.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
dconf.ui split deck description into separate screen linked from overview 2021-04-22 21:03:16 +10:00
debug_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
debug.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
debug.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
editaddon_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
editaddon.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
editaddon.ui update designer references 2020-11-17 19:55:18 +10:00
editcurrent_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
editcurrent.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
editcurrent.ui update designer references 2020-11-17 19:55:18 +10:00
edithtml_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
edithtml.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
edithtml.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
emptycards_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
emptycards.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
emptycards.ui update designer references 2020-11-17 19:55:18 +10:00
exporting_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
exporting.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
exporting.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
fields_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
fields.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
fields.ui Editor Field Descriptions (#1476) 2021-11-06 09:42:48 +10:00
filtered_deck_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
filtered_deck.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
filtered_deck.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
finddupes_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
finddupes.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
finddupes.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
findreplace_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
findreplace.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
findreplace.ui switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
getaddons_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
getaddons.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
getaddons.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
icons.qrc use Qt search path instead of resource system 2021-10-12 16:17:08 +10:00
importing_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
importing.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
importing.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
main_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
main.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
main.ui enable redo support 2021-05-19 15:18:39 +10:00
modelopts_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
modelopts.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
modelopts.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
models_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
models.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
models.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
preferences_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
preferences.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
preferences.ui Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
preview_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
preview.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
preview.ui initial Bazel conversion 2020-11-01 14:26:58 +10:00
profiles_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
profiles.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
profiles.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
progress_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
progress.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
progress.ui update designer references 2020-11-17 19:55:18 +10:00
reposition_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
reposition.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
reposition.ui require reposition to start at 0; cap maximum 2021-06-01 10:09:24 +10:00
setgroup_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
setgroup.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
setgroup.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
setlang_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
setlang.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
setlang.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
stats_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
stats.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
stats.ui update designer references 2020-11-17 19:55:18 +10:00
studydeck_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
studydeck.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
studydeck.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
synclog_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
synclog.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
synclog.ui initial Bazel conversion 2020-11-01 14:26:58 +10:00
taglimit_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
taglimit.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
taglimit.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
template_qt6.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
template.py generate pyqt6 forms 2021-10-15 12:57:19 +10:00
template.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00