Commit graph

9644 commits

Author SHA1 Message Date
Matthias Metelka
3d896b5949 Tweak inset shadow color 2022-09-02 18:57:36 +02:00
Matthias Metelka
98e7c37eaa Dark theme: make border-default one shade darker 2022-09-02 18:56:55 +02:00
Matthias Metelka
e39a3edeab Experiment with inset look for fields again
Is this too dark in night mode? It's the same color used for all other text inputs.
2022-09-02 18:25:37 +02:00
Matthias Metelka
d3fa137e1c Tweak card/note accent colors 2022-09-02 17:39:46 +02:00
Matthias Metelka
c5f9e9954b Reduce flag colors to single default value 2022-09-02 17:35:48 +02:00
Matthias Metelka
7d45b65ebe Light theme: darken background and flatten transition
also set hue and saturation of gray-8 to 0 (like all the other grays).
2022-09-02 15:55:23 +02:00
Matthias Metelka
690cc04edd Add back box-shadow to EditingArea 2022-09-02 15:53:58 +02:00
Matthias Metelka
98ed2813cc Adjust light theme 2022-09-02 15:28:47 +02:00
Matthias Metelka
a7c1cdfa2d Use canvas-inset variable for switch knob 2022-09-02 15:28:35 +02:00
Matthias Metelka
decfa16df2 Light theme: decrease brightness of canvas-default and adjust fg-default 2022-09-02 12:49:37 +02: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
cd726049a1 Return CSS var by default and add palette-of function for raw value 2022-08-31 21:19:53 +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
gnnoh
e4f1d9952b
Make dvipng use transparent background by default (#2036)
* make dvipng use transparent background by default

Note that if using all-lowercase 'transparent', it will give "a simple fully transparent background with non-transparent antialiased pixels", which is unnecessary.

* latex.py: format
2022-08-31 18:49:22 +10:00
wallgrenen
0eaa80dd28
change update link to point to download section (#2034) 2022-08-31 18:35:53 +10:00
BlueGreenMagick
28eae0667a
fix wrong rich-text-widget offset (#2033)
.rich-text-input { padding: 6px; }
messed up image & mathjax overlay positioning
because parent padding isn't added to absolute positioning px
2022-08-31 18:35:01 +10:00
Matthias Metelka
1498ba2c29 Use old --frame-bg color and use darker tone for canvas-default 2022-08-30 19:17:11 +02:00
Matthias Metelka
98f8ab7344 Improve uses of default-themed variables 2022-08-30 18:54:25 +02:00
Matthias Metelka
cb4afed825
Merge branch 'main' into color-palette 2022-08-30 18:17:38 +02:00
Matthias Metelka
4881f16eba Add vars_lib as dependency to base_lib and button_mixins_lib 2022-08-30 18:15:50 +02:00
Matthias Metelka
ac0d2c8954 Add functions and colors to base_lib 2022-08-30 17:56:00 +02:00
Matthias Metelka
7451b67f2a Tweak light theme border and shadow colors 2022-08-30 17:42:12 +02:00
Matthias Metelka
1b8e32e363 Fix focus box shadow transition and remove default shadow for a cleaner look
I couldn't quite get the inset look the way I wanted, because inset box-shadows do not respect the border radius, therefore causing aliasing.
2022-08-30 17:41:36 +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
bb172edf05 Adjust box-shadow of EditingArea to make fields look inset 2022-08-30 10:06:05 +02:00
Matthias Metelka
ec290a23cb Tweak gray tones 2022-08-30 10:05:59 +02:00
Matthias Metelka
b7cc8edcae Saturate highlight-bg in light theme 2022-08-29 16:04:08 +02: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
017c3938ef Replace gray tones with more neutral values 2022-08-29 06:37:16 +02:00
Matthias Metelka
b91ee5bbf7 Use --slightly-grey-text for options tab color 2022-08-29 06:35:31 +02:00
Matthias Metelka
dfe3aba2d8
Merge branch 'main' into color-palette 2022-08-29 05:08:27 +02:00
Damien Elmes
4a884d379f Fix build failing on macOS
I suspect the PyQt maintainer uploaded a new wheel and yanked the old
one, which made pip fall back on a source install which failed. If that's
the case, he really should have used a new version number, as this makes
building/bisecting older releases more cumbersome.
2022-08-25 18:04:37 +10:00
Damien Elmes
89c4441837 Fix scheduler change not reflected after normal sync 2022-08-24 18:37:58 +10:00
Aristotelis
46746e3e34
Move VS Code settings to .vscode.dist and update docs (#2029) 2022-08-24 16:08:58 +10:00
Aristotelis
825c88b6e8
Make all Anki-native exceptions inherit from the same base class (#2028)
* Make all Anki-native exceptions inherit from same base class

Allows add-ons to easily catch all Anki-native exceptions without being coupled to the currently implemented exceptions.

* Satisfy pylint
2022-08-24 16:07:44 +10:00
RumovZ
79fbb6c8d8
Keep content of unmapped fields when importing (#2023)
* Keep content of unmapped fields when importing

* Test new behaviour

* Fix typo in `canonify_tags_without_resgistering`

* Log updated note instead of original one

* Revert merging imported tags

But keep old note tags if no new ones are provided.
2022-08-24 16:04:32 +10:00
Sam Penny
45f2502e5b
fix line break in sync link in the toolbar (#2022) 2022-08-22 11:26:57 +10: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
Damien Elmes
0809812c1d Preserve background-color when pasting external content in light mode
Closes #1964
2022-08-19 12:31:26 +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
Matthias Metelka
5f6ac1a916
Field redesign (#2002)
* Adjust size of legacy buttons

* Revert "Adjust size of legacy buttons"

This reverts commit fb888fe1db.

* Remove unused function from #1476

* Use outline version for tag icon

* Add chevron icons

* Remove code icons, keep one pin icon version

* Add code-bg color

* Redesign fields

* Remove unused import

* Fix imports

* Move PlainTextBadge between editing inputs

where it belongs :)

* Make whole separator line clickable

* Fix transition

and format

* Don't show toggle when field is collapsed

* Show toggle only on hover

for mobile I'd like to implement a swipe mechanism.

* Use tweened SVG for triangle instead of CSS hack

* Implement more obvious HTML toggle on bottom right

* Reduce field height by a few pixels

* Reduce field height by two pixels

* Show HTML toggle when PlainTextInput is active, regardless of hover/focus

* Remove RichTextBadge.svelte

* Create separate collapsed field state

this means users can collapse fields with the HTML editor open and it will stay open when the field is expanded again.

* Add slide out animation to EditingArea, RichTextInput and PlainTextInput

only for collapsing, because it is choppy on expansion (common issue with Svelte transitions).

* Fix aliasing issue on focused field corners

* Make StickyBadge feel more responsive

* Move StickyBadge closer to field border

* Adjust field gutter/margins

* Make LabelContainer sticky

to make field operations accessible on fields with a lot of content.

* Add back html icons, remove visual editor icons

* Revert "Add code-bg color"

This reverts commit 4200f35419.

* Add rich text icon, remove strikethrough code icon

* Revert PlainTextBadge to original position

* Adjust margins in FieldState

* Rename PlainTextBadge to SecondaryInputBadge

in preparation for #1987

* Run eslint and prettier

* Make whole LabelContainer clickable area for collapse/expand

* Revert "Add slide out animation to EditingArea, RichTextInput and PlainTextInput"

This reverts commit 9a2b3410d0.

* Fix error on collapse/expansion

this was caused by the {#if} blocks, which resulted in the deletion of original EditingAreas.

* Refocus when toggling chevron and secondary input badge

* Revert "Revert "Add code-bg color""

This reverts commit 1cfd3bda65.

* Use single rotating chevron icon and make it RTL-compatible

* Remove redundant CSS transition rule

* Introduce animated Collapsible component and fix refocus on toggle

* Do not try to force repaint, as it is not required

* Remove RTL store from LabelContainer

the direction is already applied globally.

* Collapse secondary input with field

* Add focusedField to NoteEditorAPI

* Replace :global CSS selector with class .visible

thus removing the assumption that the component is used inside an EditorField.

https://github.com/ankitects/anki/pull/2002#discussion_r944876448

* Use named function syntax instead of function expressions

* Add explanation comment

* Remove unnecessary :bind directive

* Create CollapseBadge component

* Move :global selector into .plain-text-input

* Add comment explaining box-shadow pseudo-element

* Move Collapsible from EditingArea, PlainTextInput and RichTextInput into user components

* Rename SecondaryInputBadge to PlainTextBadge and remove generalization logic

I kept the rich text icon inside icons.ts for future use.

* Sort imports

* Fix background-color for duplicates not showing

with yet another pseudo-element :)

The pseudo-element that covers up field borders on scroll caused this issue. Fighting fire with fire here.

* Increase size of plain text toggle to original value again

This makes the clickable area a bit bigger and looks slightly more consistent with StickyBadge.

* Scrap pseudo-element mess in LabelContainer and tackle the actual issue

* Add class .visible to StickyBadge too

This introduces a peculiar bug: The active prop of StickyBadge resets to false when the mouse leaves the field - regardless of the actual back-end value.

* Fix sticky badge resetting on mouseleave/blur

* Apply overflow: hidden only during transition

fixes MathJax handle getting cut off by fields

* Remove unused variable

* Fix visual bug caused by overflow:hidden not applying in time

I tried several asynchronous approaches, but they all caused issues: either they prevented the CSS transition or they made field inputs lose focus.

In the end I resorted to direct, synchronous DOM-manipulation and added an explanatory comment.

* Decrease Collapsible load time by blocking first transition

I noticed the sliding animation has a hefty performance impact when a large number of fields is loaded simultaneously.

Blocking the first transition (which isn't even visible) results in a big boost in load time.

* Replace usages of gap with margins for children

* Revert unnecessary removal of grid-gap definition

* Correct comments about flex-gap property

mistook that for grid-gap.

* Resolve style issues

* Add minimum targets to gap comment

Co-authored-by: Henrik Giesel <hengiesel@gmail.com>
2022-08-19 10:02:28 +10:00
Damien Elmes
19deb7ad25 Access certificates periodically
Tentatively closes #1965
2022-08-19 10:00:38 +10:00
Matthias Metelka
f8f3f28d08 Adjust light theme 2022-08-18 12:38:32 +02:00
Matthias Metelka
068c2c10cf Align gray color palette more with macOS 2022-08-18 11:20:58 +02: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