summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-22 17:54:22 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-22 17:54:22 +0000
commit79276d8f304ed8e57fcc7d25b1e415ff347049ef (patch)
tree9878c849a2fad557b46d2b58f45a31f4b0f8b286 /app
parent9a4010c92ba213cfd6461c8f0c8a1ac8c27631de (diff)
downloadchromium_src-79276d8f304ed8e57fcc7d25b1e415ff347049ef.zip
chromium_src-79276d8f304ed8e57fcc7d25b1e415ff347049ef.tar.gz
chromium_src-79276d8f304ed8e57fcc7d25b1e415ff347049ef.tar.bz2
Fix bad tooltip wrapping.
Bug=32857 Test=Create a document with a long title. Open it. Hover over the tab title. Even if the text is elided it should be only 1 line tall. Review URL: http://codereview.chromium.org/543166 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36869 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/gfx/font_gtk.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/app/gfx/font_gtk.cc b/app/gfx/font_gtk.cc
index 244810a..e5855c9 100644
--- a/app/gfx/font_gtk.cc
+++ b/app/gfx/font_gtk.cc
@@ -56,7 +56,21 @@ Font Font::CreateFont(PangoFontDescription* desc) {
// TODO(agl): remove this.
std::wstring font_family = FindBestMatchFontFamilyName(family_name);
- return Font(CreateFont(font_family, size / PANGO_SCALE));
+ Font font = CreateFont(font_family, size / PANGO_SCALE);
+ int style = 0;
+ if (pango_font_description_get_weight(desc) == PANGO_WEIGHT_BOLD) {
+ // TODO(davemoore) What should we do about other weights? We currently
+ // only support BOLD.
+ style |= BOLD;
+ }
+ if (pango_font_description_get_style(desc) == PANGO_STYLE_ITALIC) {
+ // TODO(davemoore) What about PANGO_STYLE_OBLIQUE?
+ style |= ITALIC;
+ }
+ if (style != 0) {
+ font = font.DeriveFont(0, style);
+ }
+ return Font(font);
}
// Get the default gtk system font (name and size).