diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-27 22:56:36 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-27 22:56:36 +0000 |
commit | 8098d2d7169e5f3d004194d10b3aafa83b445637 (patch) | |
tree | ed061ebc751578cd281ef2b2d56073fef106feb6 /chrome/browser/gtk/go_button_gtk.cc | |
parent | 6d66b7427180321470900d3d58ad63d4ea6df082 (diff) | |
download | chromium_src-8098d2d7169e5f3d004194d10b3aafa83b445637.zip chromium_src-8098d2d7169e5f3d004194d10b3aafa83b445637.tar.gz chromium_src-8098d2d7169e5f3d004194d10b3aafa83b445637.tar.bz2 |
Ellipsize long entries in bookmark menus and the back/forward menus.
Also ellipsize long tooltips.
Also make the bookmark bar tooltips more like window (Title on one line, then url on the next line). I've made the title bold, although that isn't the case on windows.
Menus: Prefer popping downwards rather than upwards when there is more space down than up.
BUG=18617
BUG=20120
Review URL: http://codereview.chromium.org/175004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24685 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/go_button_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/go_button_gtk.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/gtk/go_button_gtk.cc b/chrome/browser/gtk/go_button_gtk.cc index 81b8e52..e4606bb 100644 --- a/chrome/browser/gtk/go_button_gtk.cc +++ b/chrome/browser/gtk/go_button_gtk.cc @@ -19,6 +19,10 @@ #include "grit/generated_resources.h" #include "grit/theme_resources.h" +// Limit the length of the tooltip text. This applies only to the text in the +// omnibox (e.g. X in "Go to X"); +const size_t kMaxTooltipTextLength = 400; + GoButtonGtk::GoButtonGtk(LocationBarViewGtk* location_bar, Browser* browser) : location_bar_(location_bar), browser_(browser), @@ -193,7 +197,8 @@ gboolean GoButtonGtk::OnQueryTooltip(GtkTooltip* tooltip) { std::wstring current_text_wstr(location_bar_->location_entry()->GetText()); if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) l10n_util::WrapStringWithLTRFormatting(¤t_text_wstr); - string16 current_text = WideToUTF16Hack(current_text_wstr); + string16 current_text = WideToUTF16Hack( + l10n_util::TruncateString(current_text_wstr, kMaxTooltipTextLength)); AutocompleteEditModel* edit_model = location_bar_->location_entry()->model(); |