Anki is a smart spaced repetition flashcard program
Find a file
Matthias Metelka f169ee0933
Revamp Preferences, implement Minimalist Mode and Qt widget gallery to test GUI changes (#2289)
* Create widget gallery dialog

* Add WidgetGallery to debug dialog

* Use enum for its intended purpose

* Rename "reduced-motion" to "reduce-motion"

* Add another border-radius value

and make former large radius a bit smaller.

* Revamp preferences, add minimalist mode

Also:
- create additional and missing widget styles and tweak existing ones
- use single profile entry to set widget styles and reduce choices to Anki and Native

* Indent QTabBar style definitions

* Add missing styles for QPushButton states

* Fix QTableView background

* Remove unused layout from Preferences

* Fix QTabView focused tab style

* Highlight QCheckBox and QRadioButton when focused

* Fix toolbar styles

* Reorder preferences

* Add setting to hide bottom toolbar

* Move toolbar settings above minimalist modes

* Remove unused lines

* Implement proper full-screen mode

* Sort imports

* Tweak deck overview appearance in minimalist mode

* Undo TitledContainer changes

since nobody asked for that

* Remove dynamic toolbar background from minimalist mode

* Tweak buttons in minimalist mode

* Fix some issues

* Reduce theme check interval to 5s on Linux

* Increase hide timer interval to 2s

* Collapse toolbars with slight delay when moving to review state

This should ensure the bottom toolbar collapses too.

* Allow users to make hiding exclusive to full screen

* Rename full screen option

* Fix hide mode dropdown ignoring checkbox state on startup

* Fix typing issue

* Refine background image handling

Giving the toolbar body the main webview height ensures background-size: cover behaves exactly the same.

To prevent an override of other background properties, users are advised to only set background-images via the background-image property, not the background shorthand.

* Fix top toolbar getting huge when switching modes

The issue was caused by the min-height hack to align the background images. A call to web.adjustHeightToFit would set the toolbar to the same height as the main webview, as the function makes use of document.offsetHeight.

* Prevent scrollbar from appearing on bottom toolbar resize

* Cleanup

* Put review tab before editing; fix some tab orders

* Rename 'network' to 'syncing'

* Fix bottom toolbar disappearing on UI > 100

* Improve Preferences layout by adding vertical spacers to the bottom

also make the hiding of video_driver and its label more obvious in preferences.py.

* Fix bottom toolbar animating on startup

Also fix bottom toolbar not appearing when unchecking hide mode in reviewer.

* Hide/Show menubar in fullscreen mode along with toolbar

* Attempt to fix broken native theme on macOS

* Format

* Improve native theme on other systems by not forcing palette

with the caveat that theme switching can get weird.

* Fix theme switching in native style

* Remove redundant condition

* Add back check for Qt5 to prevent theme issues

* Add check for macOS before setting fusion theme

* Do not force scrollbar styles on macOS

* Remove all of that crazy theme logic

* Use canvas instead of button-bg for ColorRole.Button

* Make sure Anki style is always based on Fusion

otherwise we can't guarantee the same look on all systems.

* Explicitly apply default style when Anki style is not selected

This should fix the style not switching back after it was selected.

* Remove reduncant default_palette

* Revert 8af4c1cc2

On Mac with native theme, both Qt5 and Qt6 look correct already. On
the Anki theme, without this change, we get the fusion-style scrollbars
instead of the rounded ones.

* Rename AnkiStyles enum to WidgetStyle

* Fix theme switching shades on same theme

* Format

* Remove unused placeholderText

that caused an error when opening the widget gallery on Qt5.

* Check for full screen windowState using bitwise operator

to prevent error in Qt5.

Credit: https://stackoverflow.com/a/65425151

* Hide style option on Windows

also exclude native option from dropdown just in case.

* Format

* Minor naming tweak
2023-01-18 21:24:16 +10:00
.buildkite Whitelist dependabot 2023-01-07 09:53:29 +10:00
.cargo Re-enable formatting for .toml files 2022-11-28 09:16:28 +10:00
.config Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00
.github/ISSUE_TEMPLATE Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
.vscode.dist Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
build Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00
cargo Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00
docs Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00
ftl Revamp Preferences, implement Minimalist Mode and Qt widget gallery to test GUI changes (#2289) 2023-01-18 21:24:16 +10:00
proto Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00
pylib Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00
python Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00
qt Revamp Preferences, implement Minimalist Mode and Qt widget gallery to test GUI changes (#2289) 2023-01-18 21:24:16 +10:00
rslib Replace newlines with linebreaks when importing without HTML 2023-01-18 21:00:33 +10:00
sass Revamp Preferences, implement Minimalist Mode and Qt widget gallery to test GUI changes (#2289) 2023-01-18 21:24:16 +10:00
tools Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00
ts Revamp Preferences, implement Minimalist Mode and Qt widget gallery to test GUI changes (#2289) 2023-01-18 21:24:16 +10:00
.deny.toml Migrate from slog to tracing 2022-12-24 10:44:40 +10:00
.dprint.json Update Chrono Crate (#2242) 2022-12-07 17:00:14 +10:00
.eslintrc.js Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
.gitattributes try again to improve GitHub's language stats 2021-01-20 13:20:45 +10:00
.gitignore Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00
.gitmodules Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
.isort.cfg Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
.mypy.ini Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
.prettierignore Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
.prettierrc Mathjax editor improvements (#1502) 2021-11-23 10:27:32 +10:00
.pylintrc Switch back to winrt to see if it fixes slow TTS 2022-12-06 20:30:54 +10:00
.rustfmt-empty.toml Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
.rustfmt.toml Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00
.version Bump version 2023-01-09 11:08:53 +10:00
Cargo.lock Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00
Cargo.toml Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00
CONTRIBUTORS Nested clozes and increased cloze meta data (#2141) 2022-12-19 12:03:15 +10:00
LICENSE move aqt_data into source folder; implement wheel building 2020-11-04 12:14:03 +10:00
ninja Add env var to enable sourcemaps 2022-12-04 11:37:16 +10:00
package.json Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
pkgkey.asc add public key for release signing 2018-09-18 10:40:45 +10:00
README.md fix build badge 2021-06-24 09:21:56 +10:00
run Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
run.bat Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
rust-toolchain.toml Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
SECURITY.md add SECURITY.md 2021-09-22 22:55:19 +10:00
yarn.lock Update json5 due to CWE 2023-01-03 13:03:25 +10:00

Anki

Build status

This repo contains the source code for the computer version of Anki.

If you'd like to try development builds of Anki but don't feel comfortable building the code, please see https://betas.ankiweb.net/

For more information on building, please see Development.