From a02c37666ea431312f25cc8f5b98a895c4db4fd7 Mon Sep 17 00:00:00 2001 From: "sky@chromium.org" Date: Tue, 22 Dec 2009 00:34:08 +0000 Subject: Fixes bug in tabstrip that could result in no tooltip text for pinned tab. This happened because we weren't setting the title_bounds_, which is used to determine if a tab should have tooltip text. BUG=26079 TEST=see bug Review URL: http://codereview.chromium.org/507062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35122 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/views/tabs/tab_renderer.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc index cdc1488..8d5a4a3 100644 --- a/chrome/browser/views/tabs/tab_renderer.cc +++ b/chrome/browser/views/tabs/tab_renderer.cc @@ -526,11 +526,10 @@ void TabRenderer::Layout() { close_button_->SetVisible(false); } + int title_left = favicon_bounds_.right() + kFavIconTitleSpacing; + int title_top = kTopPadding + (content_height - title_font_height) / 2; // Size the Title text to fill the remaining space. if (!pinned() || width() >= kPinnedTabRendererAsTabWidth) { - // Size the Title text to fill the remaining space. - int title_left = favicon_bounds_.right() + kFavIconTitleSpacing; - 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. @@ -548,6 +547,8 @@ void TabRenderer::Layout() { } title_bounds_.SetRect(title_left, title_top, title_width, title_font_height); + } else { + title_bounds_.SetRect(title_left, title_top, 0, 0); } // Certain UI elements within the Tab (the favicon, etc.) are not represented -- cgit v1.1