Skip to content
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

WebView2: Some default platform shortcuts are disabled, some are not #569

Closed
1 of 2 tasks
JensMertelmeyer opened this issue May 4, 2022 · 3 comments · Fixed by #586
Closed
1 of 2 tasks

WebView2: Some default platform shortcuts are disabled, some are not #569

JensMertelmeyer opened this issue May 4, 2022 · 3 comments · Fixed by #586

Comments

@JensMertelmeyer
Copy link
Contributor

Describe the bug
By default, you can zoom in and out by

  1. [Ctrl] + [minus] / [plus]
  2. [Ctrl] + [Mousewheel]
  3. Two-finger-pinch on trackpad
  4. Two-finger-pinch on touchscreen

Currently, wry disables option 1 and 2, but option 3 and 4 are still possible.

Steps To Reproduce

  • cargo run --example hello_world
  • You cannot zoom by [Ctrl] + [+ / -] or [Ctrl] + [Mousewheel]
  • You can, however, zoom in by using a trackpad or touchscreen

Expected behavior
Zooming in and out should either be enabled for all platform shortcuts or for none.
Ideally, it should be configurable, whether zoom is allowed or not.

Screenshots

IMG_6514_Trim2.1.mp4

Platform and Versions (please complete the following information):
OS: Windows 10
Rustc: 1.60

Would you assign yourself to resolve this bug?

  • Yes
  • No

Additional context
I have a PR ready that will add a with_zoom(bool) to the WebViewBuilder which enables or disables all of the four ways to zoom (only implemented for Windows/WebView2). Please let me know if I can submit it for review.

@keiya01
Copy link
Member

keiya01 commented May 5, 2022

We added zoom feature in #388 but we need to implement shortcuts manually.

@JensMertelmeyer
Copy link
Contributor Author

JensMertelmeyer commented May 5, 2022

#388 added the option to manually set the zoom level in wry.
I took the above video with your (most welcome! ❤) changes from #388 already in place.

But I disagree that we should try to "imitate" the platform default shortcuts by implementing it manually again when we can, instead, just use them because it's already there.

I am suggesting to have an option to enable or disable the default platform zooming behaviour.

Right now, zooming by keyboard and mouse wheel is always off

settings
.SetIsZoomControlEnabled(false)

... while zooming by touch screen or trackpad is always enabled. This is not consistent.

@amrbashir
Copy link
Member

lets see a PR and probably just disable it without providing any options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants