-
Notifications
You must be signed in to change notification settings - Fork 190
Enable zooming on macOS WebKit control with Command +/- keys #3048
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
base: master
Are you sure you want to change the base?
Enable zooming on macOS WebKit control with Command +/- keys #3048
Conversation
1ca13d3 to
2322c40
Compare
|
Would a similar change also work for webkit on linux? And if I understand it correctly, this does not zoom the web page but "only" increases the font - icon etc. stay unchanged. |
Test Results (macos) 54 files 54 suites 7m 56s ⏱️ Results for commit 574552f. ♻️ This comment has been updated with latest results. |
The current changes are only in the cocoa part for MacOS. Support for linux need to be done separatly; I don't know and have not checked if the linux webkit implementation also supports these two methods. Yes, the native calls makeTextLarger/makeTextSmaller only change the font size, not the icons. The benefit from this solution is that it doesn't require javascript and works also for the scenario when Javascript is explictly disabled in the Browser control like in the Java Element Info. |
|
https://webkitgtk.org/reference/webkit2gtk/2.36.5/WebKitWebView.html#webkit-web-view-set-zoom-level |
I don't see any equivalent API on cocoa, at least not for the legacy API that SWT uses: For the newer API there is something: |
I first tried the new WKWebView API for pagezoom and it simply didn't work. I also then found out that Eclipse uses the old deprecated API https://developer.apple.com/documentation/webkit/webview-swift.class?language=objc . Let's hope that Apple will not delete this API. I see the need that we will switch to the new WKWebView API. |
|
Don't ever merge. Only rebase. I don't think we even can accept PRs with merges. |
I clicked the "Update Branch" button in the github UI - big mistake - why is the button visible? |
If keydown events for Command +/= or Command - are not consumed by any event handler, invoke the native methods `makeTextLarger` or `makeTextSmaller` on the WebKit control to provide zooming functionality on macOS.
1d781db to
574552f
Compare
|
Build error not related to this change? Who can help to fix this issue? |
|
That's just this cursed issue: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/6783 I just restarted the build and hope the curse is lifted... |
|
thanks a lot for the help @merks |

If keydown events for Command +/= or Command - are not consumed by any event handler, invoke the native methods
makeTextLargerormakeTextSmalleron the WebKit control to provide zooming functionality on macOS.#3036