Commit 15b9275f authored by msw@chromium.org's avatar msw@chromium.org

Vertically center excessively tall Views tab titles.

This generally matches the behavior before r276566.
See before/after pics at http://crbug.com/402814#c4

BUG=402814
TEST=Hindi and tall font tab titles look okay on Views.
R=sky@chromium.org

Review URL: https://codereview.chromium.org/464943002

Cr-Commit-Position: refs/heads/master@{#289073}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289073 0039d316-1c4b-4281-b951-d872f2087c98
parent 315ef294
...@@ -798,6 +798,11 @@ void Tab::Layout() { ...@@ -798,6 +798,11 @@ void Tab::Layout() {
kViewSpacing - title_left; kViewSpacing - title_left;
} }
gfx::Rect rect(title_left, lb.y(), std::max(title_width, 0), lb.height()); gfx::Rect rect(title_left, lb.y(), std::max(title_width, 0), lb.height());
const int title_height = title_->GetPreferredSize().height();
if (title_height > rect.height()) {
rect.set_y(lb.y() - (title_height - rect.height()) / 2);
rect.set_height(title_height);
}
rect.set_x(GetMirroredXForRect(rect)); rect.set_x(GetMirroredXForRect(rect));
title_->SetBoundsRect(rect); title_->SetBoundsRect(rect);
} }
......
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