Commit graph

2919 commits

Author SHA1 Message Date
Matthias Metelka
ff36297456
Merge branch 'redesign-test' into custom-qt-controls 2022-09-04 15:57:58 +02:00
Matthias Metelka
bbab485373
Merge branch 'main' into color-palette 2022-09-04 15:51:55 +02:00
Matthias Metelka
6bb45355d1 Remove reimport of Any 2022-09-04 15:49:56 +02:00
Matthias Metelka
72c7cb674a Use isinstance for comparison 2022-09-04 15:47:32 +02:00
Matthias Metelka
cdfa6ebd40 Adjust padding of QComboBox and its drop-down arrow 2022-09-04 15:33:29 +02:00
Matthias Metelka
3fdbd95e40
Merge branch 'main' into custom-qt-controls 2022-09-04 14:40:50 +02:00
Matthias Metelka
29d3156d3d Add type annotations to eventFilter 2022-09-04 14:38:26 +02:00
Matthias Metelka
4e8c7e819f Apply styles to all platforms
mainly so people like @hgiesel can easily test the widget style overrides, but maybe you actually prefer them over the native ones, who knows :)
2022-09-04 14:01:02 +02:00
Matthias Metelka
123e2377de Merge branch 'main' into custom-qt-controls 2022-09-04 13:57:24 +02:00
Matthias Metelka
74d06241da Tweak disabled state of SpinBox button 2022-09-04 13:56:48 +02:00
Matthias Metelka
b4101d9d97 Add blue colors for primary buttons 2022-09-04 13:38:30 +02:00
Matthias Metelka
970148e231 Make webview scrollbar look identical to Qt one 2022-09-04 13:38:05 +02:00
Matthias Metelka
86b78256f7 Create stylesheet overrides for various Qt widgets
Including QPushButton, QComboBox, QSpinBox, QLineEdit, QListWidget, QTabWidget, QTreeWidget, QToolTip, QTableView, QScrollBar and sub-widgets.
2022-09-04 11:34:03 +02:00
Matthias Metelka
e2193950a9
Add animation toggle to preferences (#2041)
* Add animation toggle to preferences

and move settings affecting appearance together.

* Add class to body if animations unchecked

* Fix formatting in preferences.ftl

* Update duration(height) function for Collapsible transition

and add explanation.

* Fix formatting

* Increase duration baseline to 10 and decrease factor to 20

* Restore initial layout and rename option to "Reduce motion"

* Move checkboxes together and fix tab order (dae)

+ Remove separation of UI size
2022-09-03 12:14:47 +10:00
Matthias Metelka
6295f50587
Merge branch 'main' into color-palette 2022-09-02 19:05:58 +02:00
Matthias Metelka
a7c1cdfa2d Use canvas-inset variable for switch knob 2022-09-02 15:28:35 +02:00
RumovZ
31b7464c67
Add card meta for persisting custom scheduling state (#2040)
* Add card meta for persisting custom scheduling state

* Rename meta -> custom_data

* Enforce limits on size of custom data

Large values will slow down table scans of the cards table, and it's
easier to be strict now and possibly relax things in the future than
the opposite.

* Pack card states and customData into a single message

+ default customData to empty if it can't be parsed

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2022-09-02 11:22:49 +10:00
Matthias Metelka
e4f3f9bf41
Merge branch 'main' into color-palette 2022-08-31 22:07:22 +02:00
Matthias Metelka
ac928225f9 Showcase use of palette-of function
The #{...} syntax is required only because the use cases are CSS var definitions. In other cases a simple palette-of(keyword, theme) would suffice.
2022-08-31 21:21:54 +02:00
Matthias Metelka
d110c4916c
Introduce setting to collapse field by default (#1990)
* Introduce setting to collapse field by default

* Fix schema order

* Change wording from adjective to imperative

sounds a bit less clunky

* Update rslib/src/notetype/schema11.rs (dae)

* Keep settings in single column

* Add back Toggle Visual Editor string

* Add RichTextBadge component and show it conditionally

* Reverse input order depending on default setting

* Make PlainTextInput border-radius responsive to toggle states

* Prevent first Collapsible transition differently

* Focus inputs after Collapsible transition

The double tick calls are just a temporary solution until I find the exact moment an input is focusable again.

* Use requestAnimationFrame to await focusable state

Note: Svelte tick doesn't seem to work in this scenario.
2022-08-31 23:34:39 +10:00
Sam Penny
65601196ee
add shortcut to close addcards window (#2031) 2022-08-31 20:09:09 +10:00
wallgrenen
0eaa80dd28
change update link to point to download section (#2034) 2022-08-31 18:35:53 +10:00
Matthias Metelka
cb4afed825
Merge branch 'main' into color-palette 2022-08-30 18:17:38 +02:00
Matthias Metelka
644ff49966 Showcase use of access functions in several locations
@hgiesel in buttons.scss I access the color palette directly. Is this what you meant by "... keep it local to the component, and possibly make it global at a later time ..."?
2022-08-30 17:17:15 +02:00
Matthias Metelka
e9f75e1756 Add Sass functions to access color palette and semantic variables
in response to https://github.com/ankitects/anki/pull/2016#issuecomment-1220571076
2022-08-30 17:14:28 +02:00
Damien Elmes
966d7f3760 Experimentally remove webview recycling
It was originally introduced for WebKit, and may no longer be pertinent
for Chromium.WebEngine.

https://forums.ankiweb.net/t/anki-glitch-showing-previous-card-answer-instead-of-new-card/12482/13
2022-08-30 21:52:22 +10:00
Matthias Metelka
f2d5abb95d Improve categorization of global colors
by renaming almost all of them and sorting them into separate maps.
2022-08-29 15:43:02 +02:00
Matthias Metelka
dfe3aba2d8
Merge branch 'main' into color-palette 2022-08-29 05:08:27 +02:00
Damien Elmes
89c4441837 Fix scheduler change not reflected after normal sync 2022-08-24 18:37:58 +10:00
Sam Penny
45f2502e5b
fix line break in sync link in the toolbar (#2022) 2022-08-22 11:26:57 +10:00
Matthias Metelka
cb287c6905 Add custom styling for Qt controls 2022-08-19 16:46:33 +02:00
Damien Elmes
fc93ea3ecc Show a pop-up when the user tries to study with V1
Closes #1991
2022-08-19 12:43:17 +10:00
Sam Bradshaw
92171e25e6
Add MessageBox class and associated funcs to aqt.utils and update the first few callers (#2010)
* Add MessageBox class and associated funcs to aqt.utils and update some callers in aqt.sync and aqt.addons

* Cleanup imports in aqt.sync

* Fix return values for ask_user and ask_user_dialog

* Fix wrong argument name in aqt.utils.ask_user

* Add type annotations to **kwargs in utils.py

* Type annotation for callback in aqt.sync.full_sync

* MessageBox accepts StandardButton in addition to str, fix linting issues

* Assess default buttons in correct order and return correct button name in MessageBox

* Add explicit Optionals in aqt.utils

* Pass button index to callback in MessageBox

* Update type hints for aqt.utils.MessageBox

* Use Sequence for aqt.utils.MessageBox buttons arg

* default_button > default_yes in aqt.utils.ask_user

* Dark mode question icon  in aqt.utils.MessageBox
2022-08-19 10:04:58 +10:00
Damien Elmes
19deb7ad25 Access certificates periodically
Tentatively closes #1965
2022-08-19 10:00:38 +10:00
Matthias Metelka
b6f9c9a64e Revert QComboBox stylesheet override 2022-08-18 11:20:58 +02:00
Matthias Metelka
ac4c88afdc Merge branch 'main' into color-palette 2022-08-18 11:20:58 +02:00
Matthias Metelka
e036edd584 Move custom QLineEdit styles out of searchbar.py 2022-08-18 11:20:58 +02:00
Matthias Metelka
59d618851d Use different map structure for _vars.scss
after @hgiesel's idea: https://github.com/ankitects/anki/pull/2016#discussion_r947087871
2022-08-18 11:20:58 +02:00
Matthias Metelka
7517af4942
Fix not being able to scroll when mouse hovers PlainTextInput (#2019)
* Remove overscroll-behavior: none for * (all elements)

* Revert "Remove overscroll-behavior: none for * (all elements)"

This reverts commit 189358908c.

* Use body instead of *, but keep CSS rule

* Unify two CSS rules
2022-08-18 12:48:28 +10:00
Matthias Metelka
d1cbb86178
Default input setting in fields dialog (#1987)
* Introduce field setting to use plain text editor by default

* Remove leftover function from #1476

* Use boolean instead of string

* Simplify clear_other_field_duplicates

* Convert plain text key to camelCase

* Move HTML item below the existing checkbox, instead of to the right (dae)

Showing it on the right is more space efficient, but feels a bit
cluttered IMHO.
2022-08-18 12:30:18 +10:00
Damien Elmes
75723d7c9c
Add option in math dropdown to toggle MathJax rendering (#2014)
* Add option in math dropdown to toggle MathJax rendering

Closes #1942

* Hackily redraw the page when toggling MathJax

* Add Fluent string
2022-08-18 12:06:06 +10:00
Matthias Metelka
bcf8992a9d Define styling for QComboBox and QLineEdit globally 2022-08-16 22:35:34 +02:00
Matthias Metelka
dfe06c0643 Give deck browser entries --frame-bg as background color 2022-08-16 22:34:20 +02:00
Matthias Metelka
04781de828 Use same placeholder color for all inputs 2022-08-16 19:27:44 +02:00
Matthias Metelka
cb9b452666 Use custom colors for note view switch 2022-08-16 14:54:48 +02:00
Matthias Metelka
6c48dbcc7f Implement color palette using Sass maps
I hand-picked the gray tones, the other colors are from the Tailwind CSS v3 palette.

Significant changes:
- light theme is brighter
- dark theme is darker
- borders are softer

I also deleted some platform- and night-mode-specific code.
2022-08-16 14:54:12 +02:00
Matthias Metelka
fb197aa32e Remove --medium-border variable 2022-08-16 14:16:22 +02:00
Matthias Metelka
d5945a213a
Make sidebar search input more pleasant to look at (#2009)
* Improve margins

* Remove right border on non-macOS systems

Would be interesting to know why this was implemented in the first place. Looks quite ugly on Linux.

* Add focus border

* Align height of toolbar icons with search bar

* Remove leftover f-strings
2022-08-15 13:08:44 +10:00
Matthias Metelka
99f4f68aca
Make switch knob smaller than path (#2008)
to ensure contrast when we move to a lighter window-bg color.
2022-08-15 13:05:20 +10:00
Sam Penny
21812556a6
Serialize modal popups at startup (#2000)
* call_add-on_update_after_initial_sync

* Add safeMode restriction

* check for anki update after other modal dialogs

* fix failing test

* make changes suggested in review
2022-08-09 13:40:52 +10:00