Commit e106b880 authored by Bret Sepulveda's avatar Bret Sepulveda Committed by Commit Bot

Ensure caption button height for maximized windows isn't too large.

Pre-Refresh a maximized window had a very condensed tabstrip, so it made
sense to set Windows 10's caption button height to (slightly less than)
the tabstrip height. Refresh tabs are much taller though, so now they
look way too big. This patch caps their height at the restored height,
since that's what Windows does in the same case.

Bug: 855802
Change-Id: I305491442462a8979388cb78e0be3975d9f1c88f
Reviewed-on: https://chromium-review.googlesource.com/1116188
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570873}
parent 7634f5b5
......@@ -37,16 +37,18 @@ gfx::Size Windows10CaptionButton::CalculatePreferredSize() const {
// TODO(bsep): The sizes in this function are for 1x device scale and don't
// match Windows button sizes at hidpi.
constexpr int kButtonHeightRestored = 29;
int h = kButtonHeightRestored;
int height = kButtonHeightRestored;
if (frame_view_->IsMaximized()) {
h = frame_view_->browser_view()->IsTabStripVisible()
int maximized_height =
frame_view_->browser_view()->IsTabStripVisible()
? frame_view_->browser_view()->GetTabStripHeight()
: frame_view_->TitlebarMaximizedVisualHeight();
constexpr int kMaximizedBottomMargin = 2;
h -= kMaximizedBottomMargin;
maximized_height -= kMaximizedBottomMargin;
height = std::min(height, maximized_height);
}
constexpr int kButtonWidth = 45;
return gfx::Size(kButtonWidth + GetBetweenButtonSpacing(), h);
return gfx::Size(kButtonWidth + GetBetweenButtonSpacing(), height);
}
namespace {
......
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