Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: ui/views/controls/tree/tree_view.cc

Issue 24883002: Uses and returns the fractional width in text eliding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win bots Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/tree/tree_view.cc
diff --git a/ui/views/controls/tree/tree_view.cc b/ui/views/controls/tree/tree_view.cc
index 78d4693e4a7fafecd0230d8bc0b5fe479580b1ee..a10100f5e08a0d3d69ed9112f9285da5328820f1 100644
--- a/ui/views/controls/tree/tree_view.cc
+++ b/ui/views/controls/tree/tree_view.cc
@@ -674,9 +674,9 @@ void TreeView::ConfigureInternalNode(TreeModelNode* model_node,
}
void TreeView::UpdateNodeTextWidth(InternalNode* node) {
- int width = 0, height = 0;
- gfx::Canvas::SizeStringInt(node->model_node()->GetTitle(), font_,
- &width, &height, 0, gfx::Canvas::NO_ELLIPSIS);
+ float width = 0, height = 0;
+ gfx::Canvas::SizeStringToFit(node->model_node()->GetTitle(), font_,
+ &width, &height, 0, gfx::Canvas::NO_ELLIPSIS);
node->set_text_width(width);
}

Powered by Google App Engine
This is Rietveld 408576698