diff options
-rw-r--r-- | chrome/browser/gtk/tabs/tab_renderer_gtk.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc index d9e96a5..f0c228f 100644 --- a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc @@ -544,10 +544,14 @@ void TabRendererGtk::Layout() { if (!is_pinned() || width() >= kPinnedTabRendererAsTabWidth) { // Size the Title text to fill the remaining space. int title_left = favicon_bounds_.right() + kFavIconTitleSpacing; - // Center the text in the content area. We need to shift the text up by a - // pixel to match Windows. TODO(estade): Figure out why we need to shift - // the text up by a pixel. http://crbug.com/18555 - int title_top = kTopPadding + (content_height - title_font_height_) / 2 - 1; + // Center of the text in the content area. + int center_of_text = kTopPadding + (content_height / 2); + // Distance between the top of the text and the middle of the text. + // (This should actually be fTop - fAscent / 2, but we can't access fTop + // here so this is as close as we can get.) + int title_offset = title_font_height_ - title_font_->baseline() / 2; + // Top of the text. + int title_top = center_of_text - title_offset; // If the user has big fonts, the title will appear rendered too far down // on the y-axis if we use the regular top padding, so we need to adjust it |