diff options
author | simonrad@chromium.org <simonrad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-30 18:05:26 +0000 |
---|---|---|
committer | simonrad@chromium.org <simonrad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-30 18:05:26 +0000 |
commit | 077d3cf55eaeec93bb8731393b395710f15ee53a (patch) | |
tree | af5b25d6d6799481b1c619776306266c74ac43e9 /views | |
parent | 1a1005fda8589b0b73cd8bccbef79af5bf50425b (diff) | |
download | chromium_src-077d3cf55eaeec93bb8731393b395710f15ee53a.zip chromium_src-077d3cf55eaeec93bb8731393b395710f15ee53a.tar.gz chromium_src-077d3cf55eaeec93bb8731393b395710f15ee53a.tar.bz2 |
Fix tab and button tooltips being truncated with ellipsis.
Tooltips were shortened to 1/4 the width of the screen. We do not currently word-wrap, so these tooltips were truncated. This meant that you could not see the full title of some webpages. Worse, the tooltips for the Back and Forward buttons were truncated in some languages.
This change increases the max tooltip width to almost the width of the screen. An even better solution would be to word-wrap the text onto multiple lines, but that requires more sweeping changes to the TooltipManagers.
R=sky
BUG=25522,22840
TEST=Load a webpage with a very long title (eg. Google search for something super long), and mouse over the tab to get a tooltip displaying the webpage title. If long enough, it should stretch across the whole screen (minus a few pixels), and then end with an ellipsis. No tab or button tooltips should be truncated unless they reach screen width.
Review URL: http://codereview.chromium.org/343054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30596 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/widget/tooltip_manager.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/views/widget/tooltip_manager.cc b/views/widget/tooltip_manager.cc index 6f159be..65f4cbc 100644 --- a/views/widget/tooltip_manager.cc +++ b/views/widget/tooltip_manager.cc @@ -35,8 +35,10 @@ static void SplitTooltipString(const std::wstring& text, int TooltipManager::GetMaxWidth(int x, int y) { gfx::Rect monitor_bounds = Screen::GetMonitorAreaNearestPoint(gfx::Point(x, y)); - // We don't want the tooltip to get too big, otherwise it looks wrong. - return monitor_bounds.width() == 0 ? 400 : monitor_bounds.width() / 4; + // Allow the tooltip to be almost as wide as the screen. + // Otherwise, we would truncate important text, since we're not word-wrapping + // the text onto multiple lines. + return monitor_bounds.width() == 0 ? 800 : monitor_bounds.width() - 30; } // static |