Commit 02e25281 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Print Preview: Increase max size to 70% of width in large windows

Increase the size of the dialog to 70% of the window width and a
proportional height, if the browser window is much larger than 1000x660.

Bug: 1033412
Change-Id: I9cf6bab3a5b38d57dba9f49d3f82aba850d61b60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1967805
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#724758}
parent b311f693
...@@ -155,7 +155,11 @@ void PrintPreviewDialogDelegate::GetDialogSize(gfx::Size* size) const { ...@@ -155,7 +155,11 @@ void PrintPreviewDialogDelegate::GetDialogSize(gfx::Size* size) const {
size->Enlarge(-2 * kBorder, -kBorder); size->Enlarge(-2 * kBorder, -kBorder);
static const gfx::Size kMaxDialogSize(1000, 660); static const gfx::Size kMaxDialogSize(1000, 660);
size->SetToMin(kMaxDialogSize); int max_width = std::max(size->width() * 7 / 10, kMaxDialogSize.width());
int max_height =
std::max(max_width * kMaxDialogSize.height() / kMaxDialogSize.width(),
kMaxDialogSize.height());
size->SetToMin(gfx::Size(max_width, max_height));
} }
std::string PrintPreviewDialogDelegate::GetDialogArgs() const { std::string PrintPreviewDialogDelegate::GetDialogArgs() const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment