Commit graph

9676 commits

Author SHA1 Message Date
Damien Elmes
39b021f54e Switch back to clearing MathJax preview on blur
This means two clicks are required again, but that's the lesser of two
evils:

https://forums.ankiweb.net/t/anki-2-1-55-beta-mathjax-preview/23529/8

Better fixes welcome :-)
2022-10-12 14:56:38 +10:00
Damien Elmes
0571449969 Update translations 2022-10-12 14:48:26 +10:00
Matthias Metelka
cc8b09f433 Move MathJax toggle to OptionsButton and fix two bugs (#2126)
* Rename MathJax toggle and move it to OptionsButton

* Apply MathJax setting to newly added blocks

* Actually remove MathJax element on delete
2022-10-12 14:34:25 +10:00
Matthias Metelka
b086dcb026 Fix SpinBox initially neglecting passed value (#2125) 2022-10-12 14:31:54 +10:00
Matthias Metelka
47523925e7 Add stylesheet for QMenu (#2122)
* Give QMenu cursor: pointer

* Darken border colors in dark theme

* Refactor cursor: pointer event filter

* Add QMenu stylesheet

* Remove min-width for QMenu item

* Add QMenuBar styles

with increased height for touchscreen users and more visible highlight color.

* Fix type

* Revert "Add QMenuBar styles"

This reverts commit 6ae405a073.

* Remove strong border from QMenu checkbox style

* Keep highlight color consistent

* Adjust highlight-bg

* Increase horizontal padding and adjust checkbox margin

* Introduce border-faint var and make default border brighter in dark mode

* Fix 1px move on hover and make highlight color more subtle

* Remove win10 styles

because the properties are set in the other stylesheets anyway.

* Fix bottom border of QMenuBar not showing underneath entries

* Remove unused import

* Make border-faint one shade darker in light theme
2022-10-12 14:29:06 +10:00
Matthias Metelka
eefefa98bb Experiment with labelled note view switch (#2117)
* Swap initial letter for full label on switch.py

* Tweak note/card accent colors

* Decrease knob radius by 1px

* Make label font smaller, but bold
2022-10-10 18:36:11 +10:00
Matthias Metelka
4a51c4e605 Fix QToolTip styling issue on Windows (#2120)
* Fix QToolTip styling issue on Windows

* Remove QToolTip styling entirely
2022-10-10 18:32:45 +10:00
Matthias Metelka
7d84827e4a Darken border colors in dark theme (#2119) 2022-10-10 14:02:15 +10:00
Matthias Metelka
f3e3dacf73 Increase vertical padding on bottom toolbar buttons (#2118) 2022-10-10 13:54:22 +10:00
Matthias Metelka
35368a1707 Set floating shift value to fit area occupied by box-shadow (#2116)
* Set floating shift value to fit area occupied by box-shadow

* Disable shift on Select dropdown
2022-10-10 13:53:13 +10:00
Matthias Metelka
74fc0d90fa Add min-width to QPushButton stylesheet (#2115)
to improve look on windows systems
2022-10-10 13:50:24 +10:00
Matthias Metelka
1098771f9f Make Qt stylesheets fully responsive to RTL (#2114)
* Make Qt stylesheets fully responsive to RTL

* Fix typing
2022-10-10 13:29:09 +10:00
BlueGreenMagick
6afe42c92d fix --frame-bg renamed to --canvas-elevated (#2107) 2022-10-10 13:15:07 +10:00
Damien Elmes
8dc37e92f2 Update to latest rules_rust
Closes #2100
2022-10-10 13:07:11 +10:00
Damien Elmes
cef47965fc Update macOS bundle to Qt 6.4.0
This bumps the minimum OS version to 10.14
2022-10-10 12:56:47 +10:00
Damien Elmes
9bcb6cf6b2 Update to Qt 6.4.0 2022-10-10 12:29:02 +10:00
Abdo
f32148416b Use showText to show add-on import errors (#2103)
* Use showText to show add-on import errors

Long error messages can be completely unreadable as QMessageBox doesn't
show a scrollbar and the text can't be selected and copied by default (on Windows at least).

* HTML-escape error
2022-10-06 18:15:56 +10:00
Matthias Metelka
bd2a7c93e0 Fix selected tags not being highlighted (#2104)
* Give selected AutocompleteItem primary button style

* Fix formatting
2022-10-03 13:25:55 +10:00
Matthias Metelka
cf31dc36ce Fix duplicate highlight and improve aesthetic (#2102) 2022-10-03 13:16:54 +10:00
Matthias Metelka
7376b238ed Make auto-closing of HTML tags default but optional (#2101) 2022-10-03 13:14:57 +10:00
Hikaru Y
8546facdd0 Fix scrolling with keys / keyboard event listeners not working on answer side (#2099)
* Revert "Fix reviewer shortcuts being inaccessible due to IME"

This reverts commit b1208aad15.

* Work around WebEngine/IME bug in Qt6
2022-10-03 12:53:09 +10:00
Aristotelis
8c4c18c0e5 Add API shim for webview.get_window_bg_color (#2095)
* Maintain shim for webview.get_window_bg_color

Used by the AMBOSS add-on

* Fix deprecation message
2022-10-03 12:50:22 +10:00
Damien Elmes
c2f32eed04 Update d3 deps for CWE 2022-09-30 14:22:23 +10:00
Damien Elmes
8c89a7fc44 Fix type answer warning making text bold 2022-09-30 14:08:03 +10:00
Damien Elmes
b781123d41 Fix font size not being removed when pasting between fields 2022-09-30 14:05:03 +10:00
Matthias Metelka
b4e37be6f0 Set line-height = 1 on inline floating-reference (#2096) 2022-09-30 11:43:08 +10:00
Damien Elmes
0d2fe8c3e5 Fix theming on Windows
- Use Unix path separator
- Strip off UNC prefix when running under Bazel
2022-09-28 15:12:14 +10:00
Matthias Metelka
ae3473e225 Make tags editor resizable using Henrik's components (#2046)
* Make tags editor resizable using Henrik's components

All credit for the components goes to Henrik. I just tweaked the design a bit and implemented them in NoteEditor.

Co-Authored-By: Henrik Giesel <hengiesel@gmail.com>

* Remove PaneContent padding

Co-Authored-By: Henrik Giesel <hengiesel@gmail.com>

* Add responsive box-shadows on scroll/resize

only shown when content overflows in the respective direction.

* Remove comment

* Fix overflow calculations and shadow mix-up

This happened when I switched from using scrolledToX to overflowX booleans.

* Simplify overflow calculations

* Make drag handles 0 height/width

The remaining height requirement comes from a margin set on NoteEditor.

* Run eslint on components

* Split editor into three panes: Toolbar, Fields, Tags

* Remove upper split for now

to unblock 2.1.55 beta

* Move panes.scss to sass folder

* Use single type for resizable panes

* Implement collapsed state toggled with click on resizer

* Add button to uncollapse tags pane and focus input

* Add indicator for # of tags

* Use dbclick to prevent interference with resize state

* Add utility functions for expand/collapse

* Meddle around with types and formatting

* Fix collapsed state being forgotten on second browser open (dae)

* Fix typecheck (dae)

Our tooling generates .d.ts files from the Svelte files, but it doesn't
expect variables to be exported. By changing them into functions, they
get included in .bazel/bin/ts/components/Pane.svelte.d.ts

* Remove an unnecessary bridgeCommand (dae)

* Fix the bottom of tags getting cut off (dae)

Not sure why offsetHeight is inaccurate in this case.

* Add missing header (dae)

Co-authored-by: Henrik Giesel <hengiesel@gmail.com>
2022-09-28 14:02:32 +10:00
Damien Elmes
a981aeb4d8 Update translations 2022-09-28 11:47:59 +10:00
Damien Elmes
72a048211a Revert "Fix/autofix empty div (#2066)"
This reverts commit b8e0090069.

Reverting until #2093 can be addressed
2022-09-28 11:47:59 +10:00
Matthias Metelka
85640ca4c3 Redesign deck options inputs (#2082)
* Create _input-mixins.scss

* Use button-mixins on more elements

* Replace <select> tag with custom Select component

* Fix RevertButton causing cursor: pointer when hidden

* Increase SaveButton chevron width

* Hide floating component box-shadow when inactive

* Rework SpinBox and move it into components

* Run eslint and prettier

* Remove leftover options prop

* Pass disabled array to EnumSelector again

* Update MapperRow.svelte

* Darken QHeaderView border color

Slipping this in without an extra PR.

* Adjust disabled color, border and cursor

* Remove redundant icon definition from stylesheets

* Fix deck options initial config

* Fix z-index issues in change notetype screen

It might be best to handle z-index locally in each user component instead of hard-coded component values.

* Give web SpinBox a horizontal design

* Give QRadioButton the same treatment as QCheckBox in #2079

* Fix unused CSS selector warning with base button-mixin

* Remove redundant import

* Fix deck options save button

* Delete input-mixins and remove unused down-arrow

* Run eslint on change-notetype

* Run eslint on components
2022-09-27 12:16:45 +10:00
Damien Elmes
035c325cdf Restrict cloze shortcut workaround to non-increment case
The workaround is only needed for the option key, and seems to trip
some people up, perhaps due to the order they're pressing/releasing the
keys.

Closes #2090
2022-09-26 11:22:00 +10:00
Abdo
c3f45b6755 Fix pm.night_mode() (#2091)
* Fix pm.night_mode()

* Add deprecation notice (dae)
2022-09-26 11:06:21 +10:00
Damien Elmes
72886ed933 Simplify asReference 2022-09-26 10:04:08 +10:00
Damien Elmes
63eeee1eab Add option to shrink editor images by default (#2071)
+ Don't persist shrinking toggle

Closes #1894
2022-09-26 09:47:50 +10:00
Matthias Metelka
1fd02b4182 Fix custom webview scrollbar not showing (#2085)
* Fix custom scrollbar not showing

* Move body selector out of scrollbar mixin

* Apply custom scrollbar to child elements too

* Remove some duplicate definitions

* Run prettier
2022-09-26 09:13:06 +10:00
Damien Elmes
b2b58bba47 Add missing sim lines in build files
Latest rules_rust now requires them. Can't use the 0.16 release
due to not-yet-merged https://github.com/google/cargo-raze/pull/524
2022-09-25 12:55:55 +10:00
Matthias Metelka
77ceca08e1 Fix Qt stylesheets getting duplicated over and over again (#2083) 2022-09-24 15:57:10 +10:00
Damien Elmes
b1655226a1 Update Rust deps 2022-09-24 13:22:46 +10:00
Damien Elmes
553cadce56 Update to latest rules_rust and Rust 1.64 2022-09-24 11:12:58 +10:00
Damien Elmes
d510645da9 Update Python deps
Addresses a protobuf CVE. Required some other patches due to changes
in latest mypy and pylint.
2022-09-24 09:46:43 +10:00
Damien Elmes
c3fd0e694e Fix daily counts being included in apkg import
Fixes https://github.com/ankidroid/Anki-Android/issues/12477
2022-09-24 09:05:29 +10:00
Damien Elmes
9b11e0ac5a Compile _vars.scss in //sass
Saves an extra copy, and allows use by mobile clients
2022-09-23 13:48:18 +10:00
Damien Elmes
8c1ea54b19 Update translations 2022-09-21 13:44:44 +10:00
Damien Elmes
9651f55fad Update Mac bundle to Qt 6.3.2 2022-09-21 12:52:45 +10:00
Damien Elmes
4894ae6829 Update to Qt 6.3.2 2022-09-21 12:21:11 +10:00
Damien Elmes
b9cf5591e3 Get the runtime Qt version instead of the compile-time version
PyQt sometimes bumps the Qt libraries without changing the Python side
2022-09-21 12:21:10 +10:00
Matthias Metelka
5883aa7cae Make mdi icons for Qt themeable (#2078)
* Fix create_vars_from_map not creating vars with default definition

* Add white and black to vars

* Replace some hard-coded SVGs with mdi equivalents

* Implement function to dynamically adjust SVG icon color

* Use new svg function to make Qt stylesheet icons respond to theme changes

* Use svg function for sidebar tool icons

* Create copy for each new color instead of modifying source file

* Fix check fails

* Add custom checkbox style for #2079

* Add example of how to generate svgs during build (dae)

* Create arbitrary color variants for each icon with Bazel

* Remove unused label (dae)
2022-09-21 12:02:30 +10:00
Matthias Metelka
8136222604 Improve hover feedback on various widgets (#2079)
* Use cursor: pointer on QCheckBoxes too and exclude disabled widgets

* Left-align all QCheckBoxes to make hover-area and clickable area the same

Altough the clickable area has always been restricted to the label, the widget itself stretched all the way. This became a problem with the new cursor-pointer for checkboxes.

* Remove Switch duplicate from deck-options

* Add cursor: pointer to Switch and RevertButton

* Add cursor: pointer to bottom toolbar buttons

* Add cursor: pointer to gears

* Add cursor: pointer to radio and checkbox inputs of graphs page

* Improve button appearance in stats screen

* Add cursor: pointer to QTabBar and QToolButton

* Add cursor: pointer to non-editable QComboBox

* Center settings-will-take-effect-after notice in preferences screen

* Use public without_qt5_compat_wrapper() function

* Run prettier
2022-09-20 16:34:15 +10:00
Damien Elmes
e20b93e1c1 Always scan for media changes
The check runs in the background, and the dentry cache and SQLite
page cache should make this more efficient after the first run.

Closes #1736
2022-09-20 16:13:10 +10:00