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

Unified Diff: chrome/browser/gtk/tabs/tab_renderer_gtk.cc

Issue 160663: Use a font size of 9pt in the tab titles. This is a bit (Closed)
Patch Set: todo + bug Created 11 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/gtk/tabs/tab_renderer_gtk.cc
diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc
index c2c1bc548be8ad549dbf9dafd04f02c0b8a87d4e..7db36cb4401778245d8477f95d9ce21d5545b5a0 100644
--- a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc
@@ -543,9 +543,10 @@ 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 mean line of the text in the content area.
- int title_top = kTopPadding +
- (content_height - title_font_->baseline()) / 2;
+ // 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;
// 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
@@ -888,9 +889,10 @@ void TabRendererGtk::InitResources() {
LoadTabImages();
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- // Force the font size to 8pt.
+ // Force the font size to 9pt, which matches Windows' default font size
+ // (taken from the system).
gfx::Font base_font = rb.GetFont(ResourceBundle::BaseFont);
- title_font_ = new gfx::Font(gfx::Font::CreateFont(base_font.FontName(), 8));
+ title_font_ = new gfx::Font(gfx::Font::CreateFont(base_font.FontName(), 9));
title_font_height_ = title_font_->height();
crashed_fav_icon = rb.GetBitmapNamed(IDR_SAD_FAVICON);
« 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