diff options
author | varunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-24 09:51:53 +0000 |
---|---|---|
committer | varunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-24 09:51:53 +0000 |
commit | c8fbac345b8e2536629e2cc3ba356f55ea172f7e (patch) | |
tree | f3d5db1d8038d7b265a8fdfba6dc8122433a2626 /ui | |
parent | 1ade3f8634a12b3b149b5016d01a9b8b8c5979c5 (diff) | |
download | chromium_src-c8fbac345b8e2536629e2cc3ba356f55ea172f7e.zip chromium_src-c8fbac345b8e2536629e2cc3ba356f55ea172f7e.tar.gz chromium_src-c8fbac345b8e2536629e2cc3ba356f55ea172f7e.tar.bz2 |
views::Label displaying the tooltip should not elide.
The default eliding behavior on views::Label was changed to ELIDE_AT_END in
https://codereview.chromium.org/14654018 which make tooltips display incorrectly
in chromeos.
BUG=none
TEST=manual: trigger a long tooltip (one that cannot fit in one line). For
example, hover over the tab of any page with a long title (try the codereview
link above). Without this change, the tooltip label appears as a single line
elided at the end and has a weird size.
Review URL: https://chromiumcodereview.appspot.com/15772002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202039 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/views/corewm/tooltip_controller.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/views/corewm/tooltip_controller.cc b/ui/views/corewm/tooltip_controller.cc index 6a0608e..7f93c9e 100644 --- a/ui/views/corewm/tooltip_controller.cc +++ b/ui/views/corewm/tooltip_controller.cc @@ -98,6 +98,7 @@ class TooltipController::Tooltip : public views::WidgetObserver { kTooltipBorder)); } label_.set_owned_by_client(); + label_.SetMultiLine(true); } virtual ~Tooltip() { @@ -119,7 +120,7 @@ class TooltipController::Tooltip : public views::WidgetObserver { label_.SetText(trimmed_text); int width = max_width + 2 * kTooltipHorizontalPadding; - int height = label_.GetPreferredSize().height() + + int height = label_.GetHeightForWidth(max_width) + 2 * kTooltipVerticalPadding; if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoDropShadows)) { width += 2 * kTooltipBorderWidth; |