-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] zoom in and out functionality (ctrl/ctrl+shift + "=" and ctrl/ctrl+shift+ "-") #3310
Comments
tracking issue at tauri-apps/wry#388 |
It would seem the upstream has been fixed, I guess now it's just about extending the I may help with that if this is begginer-friendly enough |
I think this issue is related to tauri-apps/wry#569 . |
Looks like the upstream issues this depends on have been resolved. What can I do to enable this? |
even though it landed in upstream, tauri still needs to expose it. |
Bumping this up. Any idea when we'd get this into the framework? |
Bumping this up again! This would be a welcome addition to Tauri, mainly for accessibility concerns. |
Is there any workaround? I hope this gets added soon, would be great to have for accessibility. |
Can tauri add a new `zoom` configuration item in the tauri.conf.json configuration file. @FabianLars
This allows users to set the default zoom of the window |
A year has passed. I want to know how the progress of this bug is? |
In the meantime, there is a pure js based way to get Zoom working in Tauri. So one could listen to the shortcut and do this Zoom JS thingy to make Zoom work in most cases. There are some caveats to this approach as iframes are not affected by Zoom and other things some edge cases wont work as expeced in some cases. |
Also looking forward to this for accessibility. |
But how can a user of an app do that? |
This is not equivalent to zoom in browsers or in electron. For example some elements that would extend to window borders at 1.0 zoom level will cut off early if you reduce it through document.body.style.zoom. |
Hi all, managed to fix this by calling the webviews scale API from rust. See This pull request for the code changes needed(it's not much) phcode-dev/phoenix-desktop#162 . After this , call the js await __TAURI__.tauri.invoke("zoom_window", {scaleFactor:1.2}); Tested working in Windows, Linux, and mac. |
How about reading the value, though ? |
We use our own storage layer for persisting preferences as browser local storage is not reliable in tauri. You can test with local storage though where you start with 1 in a zoom jey stored in storage and increment zoom by .1 on ctrl+ keyboard shortcut and decrement on.keyboard minus. So we don't really have to read back the scaling factor back from rust layer, instead use localstorage at browser side. |
That's unreliable as well, because there's no way to ensure that zoom isn't changeable by any other means. |
That is probably how chrome/browser internally handles the zoom scale storage too, someone has to store the zoom scale factor to restore it later. If not the webkit layer, then we do it at the application side. It is pretty reliable as long as your storage layer is reliable. |
In Chrome, zoom can be changed in many ways : command line arguments, hamburger menu, Ctrl+wheel, Ctrl+keyboard... |
it worked for me. Thank a lot |
Uh, why ? |
This API is only available in Windows webview2, but we can provide a polyfill as mentioned here #9352 (comment) |
Describe the problem
Browsers such as edge and chrome have a zoom in and out functionality with hotkeys mentioned in the title, and I would like to include that in my application with tauri, but the hotkeys aren't working for me.
Describe the solution you'd like
add the hotkey support
Alternatives considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: