summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfalken@chromium.org <falken@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-23 04:17:04 +0000
committerfalken@chromium.org <falken@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-23 04:17:04 +0000
commite8e2ab171b90fbe71ca4fca5205cd25dc07dbfd0 (patch)
tree932a993202f0c165cdd38c30f31b4844ddd11e56
parent8093382a5f49c50cdb6262329a30b14f3c241ee6 (diff)
downloadchromium_src-e8e2ab171b90fbe71ca4fca5205cd25dc07dbfd0.zip
chromium_src-e8e2ab171b90fbe71ca4fca5205cd25dc07dbfd0.tar.gz
chromium_src-e8e2ab171b90fbe71ca4fca5205cd25dc07dbfd0.tar.bz2
Use ResourceBundle::BaseFont for GTK tooltips.
If no font is specified, the font used can differ from the base font. This happens when we set the UI font manually using IDS_UI_FONT_FAMILY_CROS. BUG=chromium-os:7737 TEST=manually tested on netbook and Linux Review URL: http://codereview.chromium.org/6476023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75719 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browser_main.cc11
-rw-r--r--views/widget/tooltip_manager_gtk.h2
2 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 1cc9d36..577d58e 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -903,6 +903,17 @@ void MaybeChangeUIFont() {
return;
}
gtk_util::SetGtkFont(font_name);
+
+ // Override the font set for tooltips in the gtkrc file so tooltips use the
+ // IDS_UI_FONT_FAMILY_CROS font.
+ // TODO(falken): this is a hack: make adding locale-specific changes to GTK
+ // settings cleaner. See http://crosbug.com/12257
+ std::string tooltip_style =
+ "style \"OverrideTooltipFontStyle\" = \"TooltipStyle\" {\n"
+ " font_name = \"" + font_name + "\"\n"
+ "}\n"
+ "widget \"gtk-tooltip*\" style \"OverrideTooltipFontStyle\"\n";
+ gtk_rc_parse_string(tooltip_style.c_str());
}
#endif
diff --git a/views/widget/tooltip_manager_gtk.h b/views/widget/tooltip_manager_gtk.h
index c78acec..0eb4aba 100644
--- a/views/widget/tooltip_manager_gtk.h
+++ b/views/widget/tooltip_manager_gtk.h
@@ -42,7 +42,7 @@ class TooltipManagerGtk : public TooltipManager {
// The view supplied to the last invocation of ShowKeyboardTooltip.
View* keyboard_view_;
- // Custimized tooltip window.
+ // Customized tooltip window.
TooltipWindowGtk tooltip_window_;
DISALLOW_COPY_AND_ASSIGN(TooltipManagerGtk);