From 9bd95f9f3a10790bce2c0c1993a138f463d45a5c Mon Sep 17 00:00:00 2001 From: "jhawkins@chromium.org" Date: Mon, 6 Apr 2009 19:28:16 +0000 Subject: Fix the positioning of the title in TabRendererGtk now that ChromeCanvas text rendering is fixed. TBR=deanm Review URL: http://codereview.chromium.org/62066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13175 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/gtk/tabs/tab_renderer_gtk.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'chrome/browser/gtk') diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc index 958dadd..9bbf1fd 100644 --- a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc @@ -289,16 +289,15 @@ void TabRendererGtk::Layout() { // Size the Title text to fill the remaining space. int title_left = favicon_bounds_.right() + kFavIconTitleSpacing; - int title_top = kTopPadding + (bounds_.height() + title_font_height_) / 2; + int title_top = kTopPadding + (content_height - title_font_height_) / 2; // 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 so // that the text appears centered. gfx::Size minimum_size = GetMinimumUnselectedSize(); int text_height = title_top + title_font_height_ + kBottomPadding; - if (text_height > minimum_size.height()) { + if (text_height > minimum_size.height()) title_top -= (text_height - minimum_size.height()) / 2; - } int title_width; if (close_button_bounds_.width() && close_button_bounds_.height()) { -- cgit v1.1