Commit graph

3056 commits

Author SHA1 Message Date
Matthias Metelka
8af4c1cc27 Do not force scrollbar styles on macOS 2023-01-16 11:29:29 +01:00
Matthias Metelka
54172670d3 Add check for macOS before setting fusion theme 2023-01-16 10:47:13 +01:00
Matthias Metelka
dcd924e34b Add back check for Qt5 to prevent theme issues 2023-01-16 10:08:45 +01:00
Matthias Metelka
fd06714928 Remove redundant condition 2023-01-16 10:04:51 +01:00
Matthias Metelka
bc58206a6a Fix theme switching in native style 2023-01-16 09:56:54 +01:00
Matthias Metelka
2529edb78a Improve native theme on other systems by not forcing palette
with the caveat that theme switching can get weird.
2023-01-16 09:44:37 +01:00
Matthias Metelka
46e9c1fcd8 Format 2023-01-16 09:37:31 +01:00
Matthias Metelka
792b834109 Attempt to fix broken native theme on macOS 2023-01-16 09:34:57 +01:00
Matthias Metelka
585f7354b1 Hide/Show menubar in fullscreen mode along with toolbar 2023-01-16 09:31:45 +01:00
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