summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-06 23:52:25 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-06 23:52:25 +0000
commit58fa398caf8b71a608490fee0457cf0d229c7e0d (patch)
tree2928d71e45ffe5fb024fb1dc97ab826e81dc3894 /chrome/browser
parentecceb404b0ad8412dc8f94b695502ca97682daa2 (diff)
downloadchromium_src-58fa398caf8b71a608490fee0457cf0d229c7e0d.zip
chromium_src-58fa398caf8b71a608490fee0457cf0d229c7e0d.tar.gz
chromium_src-58fa398caf8b71a608490fee0457cf0d229c7e0d.tar.bz2
GTK: Change the way to calculate the position of the tab title text.
On my machine this doesn't actually change the position, but at least it gets rid of the magic -1. BUG=18555 Review URL: http://codereview.chromium.org/165024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/gtk/tabs/tab_renderer_gtk.cc12
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