Commit graph

9850 commits

Author SHA1 Message Date
Damien Elmes
06d8f4502b Another attempt at fixing reversed toolbar on first startup
May close https://github.com/ankitects/anki/issues/2269
2022-12-13 10:51:13 +10:00
Damien Elmes
29b1bde928 Revert "Avoid setting RTL on first run"
This reverts commit 1bb6afb394.

I appear to have been confused in my earlier testing, as reverting
this change seems to make no difference the top bar on first startup,
and fixes a bunch of other regressions that the original change introduced.

https://github.com/ankitects/anki/issues/2269
2022-12-13 10:45:36 +10:00
Matthias Metelka
ee065485ad Add slight inset shadow to hovered buttons (#2267)
* Replace border-with inset shadow on button hover

* Align gradient-end with base color for primary buttons too

to achieve a more natural hover effect.
2022-12-12 15:41:23 +10:00
Matthias Metelka
e38886a3c9 Do not append description button for filtered deck (#2266) 2022-12-11 15:03:11 +10:00
Matthias Metelka
4f48fb3c41 Add style for disabled DropdownItem (#2265)
* Add style for disabled DropdownItem

* Switch back to using disabled as attribute instead of class
2022-12-11 13:06:18 +10:00
Damien Elmes
625d725f0f Fix color defaulting to black
Closes #2261
2022-12-11 11:58:21 +10:00
Damien Elmes
9cb57bebcb Update certifi to fix security alert 2022-12-11 11:42:08 +10:00
Damien Elmes
728683ffcb Fix cursor moving to field start when closing MathJax editor
Closes #2258
2022-12-11 11:39:03 +10:00
Matthias Metelka
32ac6dc5a0 Remove dark theme exclusive inset shadow from FloatingArrow (#2257) 2022-12-11 11:18:59 +10:00
Matthias Metelka
da5796bb9e Fix dropdown items wrapping (#2252) 2022-12-09 13:44:06 +10:00
Damien Elmes
ba521bbd1b Update translations 2022-12-09 12:37:27 +10:00
Damien Elmes
02d0f714e0 Increase initial add-on dialog size
I can't reproduce the reported issue, but this will probably help.

https://forums.ankiweb.net/t/anki-2-1-55-beta-7/25130/10
2022-12-09 12:36:28 +10:00
Henrik Giesel
0b57cc8482 Fix overwrite surround (#2247)
* Revert "Revert to setFormat() to fix color setting"

This reverts commit ed77c9d4fa.

* Fix overwrite-surround
2022-12-09 10:10:58 +10:00
Damien Elmes
db0fc7f334 Fix MathJax editor not hiding on blur again
Originally fixed with 39b021f54e,
accidentally reverted in #2070
2022-12-08 22:46:23 +10:00
Matthias Metelka
1564a4994a Fix popover animation causing placement switching loop (#2246) 2022-12-08 22:35:55 +10:00
Matthias Metelka
82962c8e29 Make SpinBox chevrons more subtle (#2243)
* Make SpinBox chevrons more subtle

and keep showing them when input is focused.

* Show chevrons only on hover

* Revert "Show chevrons only on hover"

This reverts commit 20e5ec1691.
2022-12-08 22:32:35 +10:00
Matthias Metelka
ffa3e1e0b3 Fix some more RTL issues (#2244)
* Swap flag and mark indicator position in RTL mode

* Make buttons of bottom toolbar align to edge of screen in RTL mode

* Use start instead of left and end instead of right
2022-12-08 22:29:56 +10:00
Damien Elmes
53cbdc82c8 Deck options: hide webview after showing dialog
This seems to reduce flicker, presumably because the webview doesn't pick
up the correct geometry until the dialog is shown.
2022-12-08 22:18:28 +10:00
Damien Elmes
ae26cdfb62 Set night-mode class on web page initialization
Ensures the background is the correct color by the time the webview
is shown. We keep the #night check for now, as it's useful when testing
in an external browser.
2022-12-08 22:02:12 +10:00
Damien Elmes
aabd29879d Add default_size argument to restoreGeom(); fix missing dialogs
The starting size of a webview seems to be 640x480, but if it is hidden
without retainSizeWhenHidden being set, the dialog it contains can end
up with a height of 0, which prevents the dialog from being shown.

By being explicit about our desired starting size, we can use a more
useful default, and avoid the issue of missing dialogs.
2022-12-08 22:02:12 +10:00
Damien Elmes
7c12bbf04a Avoid setting path when invoking git
We don't need the amended path, and it seems to break things for
a user:

https://forums.ankiweb.net/t/anki-2-1-55-beta-5-6/24870/89
2022-12-08 12:44:39 +10:00
RumovZ
40b008ec3f Update Chrono Crate (#2242)
* Remove deprecated `and_hms()`

* Update chrono

* Update licenses and fix script

* Remove deprecated Date struct

* Remove chrono pin

* Skip format check on .vscode

Was failing for no reason.

* Replace deprecated chrono functions

* Add cargo-deny to update-licenses & pin versions (dae)

* Remove time 0.1 dependency  (dae)

We don't need to wait for chrono 0.5; it was provided behind a legacy
feature flag.
2022-12-07 17:00:14 +10:00
Yoshi
5037968470 Facilitate hook updating/replacement (#2213)
* Facilitate updating of hooks

- Add instructions in contributing.md
- Change addon_config_editor_will_update_json hook to work with the new
  hookslib code

* Fix typo in docs

* Always run replaced hook

* Use lowercase list for typing

* Forbid defining both a replaced and a legacy hook
2022-12-07 15:39:57 +10:00
Matthias Metelka
a480a1c91f Persist field states with SessionOptions object (#2241)
* Persist collapsed- and field states with SessionOptions object

* Format types.ts

* Replace format function with f-string

* Give setters more descriptive parameter names

* Do not use default prefix for descriptions and fonts

since they are not meant to be changed via Svelte.
2022-12-07 15:37:46 +10:00
Matthias Metelka
6565939db6 Improve Select component and add it back to Change Notetype screen (#2239)
* Do not include oldIdx in Select change event

I included it due to confusion about the variable names in the Change Notetype components.

* Remove redundant on:change listener from NotetypeSelector

* Use Select component in Change Notetype MapperRow (again)

* Remove redundant --cols and --col-size definitions

Bootstrap divides rows into columns of equal width by default.

* Add highlight to active DropdownItem

* Remove bootstrap dropdown item styling

* Fix JS error on dropdown accept action

cause: When closing the dropdown, buttonRef was removed before the callback in setTimeout was run.
2022-12-07 15:31:37 +10:00
Damien Elmes
45387f708c Switch back to winrt to see if it fixes slow TTS
https://forums.ankiweb.net/t/slow-tts-and-duplicated-voices/25157/7

winrt blocks an upgrade from Python 3.9, so this will be a temporary
solution at best.
2022-12-06 20:30:54 +10:00
Abdo
baae784583 Fix Esc not closing TS pages (#2240) 2022-12-06 20:03:34 +10:00
Damien Elmes
ed77c9d4fa Revert to setFormat() to fix color setting
The surrounder code is somewhat complicated, and it could do with either
more documentation, or a simplification.

Closes #2121
2022-12-05 17:00:47 +10:00
Abdo
7beffe3529 Close MathJax editor when Esc is pressed (#2237) 2022-12-05 15:08:38 +10:00
Damien Elmes
a34a7c72b7 Fix the wrong notetype being selected by default
Regressed in #2082

https://forums.ankiweb.net/t/anki-2-1-55-beta-7/25130/7
2022-12-05 15:08:00 +10:00
Damien Elmes
af44926fb6 Tweak graph margins again
76901b7436 (commitcomment-91940936)
2022-12-04 21:50:58 +10:00
Damien Elmes
133300bb7c Avoid hiding webview when refreshing
When opening the graphs screen in dark mode, we want to load the
page first and then reveal the webview, to prevent a flash of white
that can appear as the page loads. Previously we did this for any
call to load_ts_page(), but this results in flicker when refreshing
an existing webview, such as the move from deck list to congrats screen.
In those cases, at least on the machines I have to test with here, the
refresh is smoother without the hide and show step.

The new window case is still not ideal - while the hide+show prevents a
flash of white, there is a flash of black instead, presumably as the
webview draws the initially-blank framebuffer with the contents of the
webview.
2022-12-04 21:17:57 +10:00
Damien Elmes
fcdd7dc23d Exempt MathJax images from image shrinking
https://forums.ankiweb.net/t/anki-2-1-55-beta-mathjax-preview/23529/18
2022-12-04 20:03:27 +10:00
Damien Elmes
76901b7436 Fix graphs not taking up full width 2022-12-04 19:48:18 +10:00
Damien Elmes
757f55cb6d Collapse margins on narrow screens 2022-12-04 19:47:03 +10:00
Damien Elmes
73009377af Fix pie chart disappearing in 2/3 column graph modes 2022-12-04 19:24:37 +10:00
Damien Elmes
01af958336 Bump Mathjax version 2022-12-04 18:01:26 +10:00
Damien Elmes
89ffab5795 Fix deck options sticky hiding itself 2022-12-04 15:07:48 +10:00
Damien Elmes
0ae9ad2053 Make the NoData overlay match the normal background color 2022-12-04 14:49:04 +10:00
Damien Elmes
5448319bb0 Allow unit tests to pass even when Qt translations overridden 2022-12-04 14:25:54 +10:00
Damien Elmes
c2bc714bac Add some left/right margins to congrats page 2022-12-04 13:58:50 +10:00
Damien Elmes
db9625532b Update translations 2022-12-04 13:38:38 +10:00
Damien Elmes
abca04aecf Rework spinner buttons (#2230)
* Align spinner buttons on right

The initial rationale for splitting them up was to be more touch friendly,
but we won't be able to use them on mobile anyway due to the conflicts
with double taps zooming in. On desktop, having them apart requires more
mouse movement when overshooting, so it's better to have them in one
place.

Text is now left-aligned again, which matches our other inputs like
learning steps.

The left/right buttons have been changed to up/down, which matches our
Qt spinners, and avoids RTL concerns.

This commit also removes the border on hover/select - it caused the
left-aligned content to flicker, and didn't look correct. Perhaps we could
add it back in a better way in the future.

* Hide spinner buttons on mobile devices

Tapping on them conflicts with the page zoom gesture.

* Remove min-height on spinner buttons

* Only show spinner on hover

Since they're only useful with a mouse, and only useful when they're
under the cursor, hiding them when focused keeps things less cluttered.
2022-12-04 13:18:49 +10:00
Matthias Metelka
7f6b57c1df Add profile manager setting to force custom qt stylesheets (#2233) 2022-12-04 12:54:39 +10:00
Matthias Metelka
c34f754526 Make button color and hover gradient fit together (#2232)
* Fix QMenu item not having different color on hover

due to the color changes in #2220.

* Remove strong border on pressed Qt widgets

* Make button gradient more subtle

by changing gradient-start on hover instead of gradient-end.

* Apply QPushButton style to QSpinBox buttons

* Improve margin of QComboBox arrow

* Make button-bg same color as button-gradient-end

This makes the hover gradient more subtle.
2022-12-04 11:48:09 +10:00
Matthias Metelka
ea7faac1a3 Decrease block padding for deck browser rows (#2231) 2022-12-04 11:45:59 +10:00
Damien Elmes
8b1e3bf6f2 Partially revert #2215
This fixes the issues mentioned on 
https://forums.ankiweb.net/t/anki-2-1-55-beta-5/24870/78

I can't seem to reproduce the extra tag being added when auto-completing
anymore, but perhaps I'm just not getting the steps right.
2022-12-04 11:37:16 +10:00
Damien Elmes
aebf9652a7 Add env var to enable sourcemaps
They slow down the build, so are not on by default.
2022-12-04 11:37:16 +10:00
Damien Elmes
805d997a69 Skip minify in debug builds 2022-12-04 10:05:16 +10:00
Damien Elmes
8e83ed45e9 Ensure certifi refresh repeats 2022-12-03 23:31:08 +10:00