Commit graph

3047 commits

Author SHA1 Message Date
Matthias Metelka
274914f2e1 Fix bottom toolbar animating on startup
Also fix bottom toolbar not appearing when unchecking hide mode in reviewer.
2023-01-16 09:29:01 +01:00
Matthias Metelka
84bd035dc8 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.
2023-01-16 09:10:09 +01:00
Matthias Metelka
b42e95463d Fix bottom toolbar disappearing on UI > 100 2023-01-16 08:28:56 +01:00
Damien Elmes
4a46d3e46b Put review tab before editing; fix some tab orders 2023-01-16 10:16:19 +10:00
Matthias Metelka
7faad8764c Cleanup 2023-01-15 18:01:57 +01:00
Matthias Metelka
cd9325f2d2 Prevent scrollbar from appearing on bottom toolbar resize 2023-01-15 18:00:21 +01:00
Matthias Metelka
7327f77dec 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.
2023-01-15 17:58:35 +01:00
Matthias Metelka
9449c9bcb2 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.
2023-01-14 16:59:29 +01:00
Matthias Metelka
fd43346c28 Fix typing issue 2023-01-14 11:22:34 +01:00
Matthias Metelka
fd6afffdcc Fix hide mode dropdown ignoring checkbox state on startup 2023-01-14 11:21:04 +01:00
Matthias Metelka
3d02c7858d Rename full screen option 2023-01-14 11:15:11 +01:00
Matthias Metelka
fa057df818 Allow users to make hiding exclusive to full screen 2023-01-14 11:15:11 +01:00
Matthias Metelka
09dc6a2ac6 Collapse toolbars with slight delay when moving to review state
This should ensure the bottom toolbar collapses too.
2023-01-14 09:58:21 +01:00
Matthias Metelka
f4c4eb6adb Increase hide timer interval to 2s 2023-01-14 09:58:21 +01:00
Matthias Metelka
5d276df334 Reduce theme check interval to 5s on Linux 2023-01-14 03:46:16 +01:00
Matthias Metelka
1346ffa526 Fix some issues 2023-01-14 03:38:47 +01:00
Matthias Metelka
506a9ad208 Remove dynamic toolbar background from minimalist mode 2023-01-14 03:20:44 +01:00
Matthias Metelka
9f5c3de28a Tweak deck overview appearance in minimalist mode 2023-01-14 03:19:33 +01:00
Matthias Metelka
c3647e2d3e Sort imports 2023-01-14 03:09:17 +01:00
Matthias Metelka
e3d11e278e Implement proper full-screen mode 2023-01-14 03:06:56 +01:00
Matthias Metelka
08f02e441d Remove unused lines 2023-01-14 02:02:39 +01:00
Matthias Metelka
8018c1dcae Move toolbar settings above minimalist modes 2023-01-14 01:58:35 +01:00
Matthias Metelka
ef54865a2c Add setting to hide bottom toolbar 2023-01-14 01:56:19 +01:00
Matthias Metelka
e5a946bb1a Reorder preferences 2023-01-14 01:55:13 +01:00
Matthias Metelka
003d3a39c7 Fix toolbar styles 2023-01-13 00:10:19 +01:00
Matthias Metelka
212a4ca2e1 Highlight QCheckBox and QRadioButton when focused 2023-01-12 22:58:32 +01:00
Matthias Metelka
352e2b4aa2 Fix QTabView focused tab style 2023-01-12 22:54:27 +01:00
Matthias Metelka
cf58470052 Remove unused layout from Preferences 2023-01-12 22:54:00 +01:00
Matthias Metelka
f1d9460a1f Fix QTableView background 2023-01-12 22:42:24 +01:00
Matthias Metelka
decfbd6698 Add missing styles for QPushButton states 2023-01-12 22:42:05 +01:00
Matthias Metelka
a4541997af Indent QTabBar style definitions 2023-01-12 22:41:18 +01:00
Matthias Metelka
9f6db2c208 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
2023-01-12 20:33:53 +01:00
Matthias Metelka
0e559bff8b Add another border-radius value
and make former large radius a bit smaller.
2023-01-12 19:53:28 +01:00
Matthias Metelka
3d8c4ead8f Rename "reduced-motion" to "reduce-motion" 2023-01-12 19:51:42 +01:00
Matthias Metelka
9373e1fbd0
Merge branch 'main' into qt-widget-gallery 2023-01-12 08:28:38 +01:00
Matthias Metelka
df456e959d
Make QCheckBox more visible (#2314) 2023-01-12 09:16:38 +10:00
Damien Elmes
10fd465edb Increase delay for mutter
It's a nasty hack, and would be nice if we could easily limit it to
users who are using Mutter.
2023-01-11 19:59:34 +10:00
Matthias Metelka
4c76bc4b0d
Merge branch 'main' into qt-widget-gallery 2023-01-11 09:33:19 +01:00
Matthias Metelka
ba822d9ee9
Simplify padding definition and center text (#2308) 2023-01-11 12:58:02 +10:00
Aristotelis
91d563278f
Fix toolbar add-on breakages and introduce toolbar tray layout & API (#2301)
* Layout toolbar using CSS grid, introducing left and right trays

The trays provide a space for add-ons to introduce their own widgets to the toolbar without interfering with each other.

* Align tray items to the top

* Move absolutely positioned add-on items to right toolbar tray

Workaround that fixes breakages in add-ons like AMBOSS, Study Timer, and potentially others that currently still inject absolutely positioned elements into the toolbar using `top_toolbar_did_init_links`.

* Account for add-ons that add manual padding (e.g. Study Timer)

* Add docstrings and slightly refactor

* Tweak item alignment

* Introduce hooks for extending left and right toolbar trays

* Assign CSS classes to all tray items

* Add disclaimer on transitional nature of new hooks
2023-01-10 08:48:50 +10:00
Matthias Metelka
9f8667fb47
Auto-hide toolbar in Reviewer (#2262)
* Give webviews a slide-in animation

if reduced motion isn't set.

* Auto-hide toolbar in review mode

moving the mouse above the main webview expands the toolbar. When the mouse leaves the toolbar, it will collapse after a delay of 2s.

* Save some space on bottom toolbars

* Use props for all hard-coded transition durations

and decrease most commonly used duration (200ms) to 150ms.

* Move auto-hide logic into ToolbarWebView

and handle auto-hide specific events in the respective webview subclasses.

* Fix typing issues

* Fix flickering issue

* Add auto_hide_toolbar opt-in to preferences

* Rename hide_toolbar to collapse_toolbar

to better describe the dock-like behaviour.

* Rename setting to minimize_distractions

* Reduce calls to pm in eventFilter

* Run formatter

* Revert setting title to something more specific

* Increase default animation time to 180ms

* Inset toolbar in review mode

when auto-hide is not enabled.

* Use card background on toolbar and add glass effect

* Use flatten/elevate over inset/outset

* Use flatten/elevate over inset/outset

* Update toolbar.py

* Fix toolbar background delay

* Tweak styles

* Use "collapse" instead of "auto-hide"

* Fix background misalignment in collapse mode

* Do not collapse toolbar when pointer is outside MainWebView

* Reduce hide_timer interval to 1000ms

* Use CSS to hide toolbar instead of setting webview height

* Add guard to prevent backdrop-filter: blur on Qt 5.14

* Apply transition to body instead of toolbar

to not complicate things for #2301.

* Fix Qt 5.14 and apply guard globally

* Fix background image scaling difference

* Tweak preference wording (dae)
2023-01-09 14:39:31 +10:00
Damien Elmes
309c467403 Work around button margins being too thin on Windows 2023-01-05 17:15:10 +10:00
Damien Elmes
bc6975973e Display a more helpful error when the locale is wrong 2023-01-04 19:01:55 +10:00
Damien Elmes
f2bb0395bf Fix unreadable text when searching in sidebar
We used to have a separate SUSPENDED_BG, but it got removed in the UI
refactor.

https://www.reddit.com/r/Anki/comments/1029gbw/is_anyone_else_with_2155_experience_way_to_bright/
2023-01-04 18:16:19 +10:00
kelciour
e9428449ff
Fix two mpv issues on Windows (#2294)
* Fix mpv with two Windows accounts at the same time

Closes #2203

* Add a workaround for audio cut off early on Windows

Closes #1730
2023-01-03 11:59:39 +10:00
Damien Elmes
ba68764fcb Another attempt at fixing missing cacert.pem
A few reports like https://forums.ankiweb.net/t/error-report-check-database-did-not-work/25796
indicate that the previous solution has not helped, and has just made things
worse. My guess is that AppNap on macOS is preventing the timer from even
running before the file gets cleaned up.
2022-12-30 15:30:53 +10:00
Matthias Metelka
4de7100475 Use enum for its intended purpose 2022-12-29 01:51:52 +01:00
Matthias Metelka
b32482f168 Add WidgetGallery to debug dialog 2022-12-29 00:45:05 +01:00
Matthias Metelka
0f0c243aa1 Create widget gallery dialog 2022-12-29 00:19:53 +01:00
Damien Elmes
272d53079f Pad buttons instead of using min-width
Qt seems to be treating min-width more like width, and truncates text.
The issue is not limited to macOS with force_custom_styles: with a
sufficiently large amount of text on a button, it truncates on other
platforms too.

https://forums.ankiweb.net/t/2-1-55-issue-with-auto-browser-and-upload-download-dialog/25636

There are a few other uses of min-width in the styling - it may be worth
checking whether they suffer from the same issue as well.
2022-12-28 12:04:44 +10:00