Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Unified Diff: chrome/browser/ui/views/tabs/tab.cc

Issue 464943002: Vertically center excessively tall Views tab titles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab.cc
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
index 8d376e60db2fd66197451b670d11ae7ac796eb19..be43953f223fa73334b1780994fd2898f23184a3 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -798,6 +798,11 @@ void Tab::Layout() {
kViewSpacing - title_left;
}
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));
title_->SetBoundsRect(rect);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698