-
-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add MacOS print options (#1259)
* feat: add MacOS print options Currently, when printing on a MacOS, it defaults to a quite big margin, which does not reflect the side of it when printing on the web. The current code just creates a new NSPrintInfo from the default, which for some reason has a large margin. This changes so that the default margin is 0 and add the option to change it when printing the webview on MacOs. This is not a field that can be changed by the user on the appkit modal, so it has to be defined before the modal is open. Other options could be added on top of these ones, but for this initial commit/PR decided to go with adding the margins since it seems to be the one with bigger discrepancy compared to the web version. References: - https://developer.apple.com/documentation/appkit/nsprintinfo
- Loading branch information
1 parent
f516122
commit 0f14e2a
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"wry": minor | ||
--- | ||
|
||
Default the margin when printing on MacOS to 0 so it is closer to the behavior of when printing on the web. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"wry": minor | ||
--- | ||
|
||
Add `WebViewExtMacOS::print_with_options` which allows to modify the margins that will be used on the print dialog. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters