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

Side by Side Diff: ui/views/controls/tree/tree_view.cc

Issue 14322007: Add line height setting to views::Label & use it for notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/label.cc ('k') | ui/views/view_text_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/tree/tree_view.h" 5 #include "ui/views/controls/tree/tree_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 } 652 }
653 653
654 void TreeView::ConfigureInternalNode(TreeModelNode* model_node, 654 void TreeView::ConfigureInternalNode(TreeModelNode* model_node,
655 InternalNode* node) { 655 InternalNode* node) {
656 node->Reset(model_node); 656 node->Reset(model_node);
657 UpdateNodeTextWidth(node); 657 UpdateNodeTextWidth(node);
658 } 658 }
659 659
660 void TreeView::UpdateNodeTextWidth(InternalNode* node) { 660 void TreeView::UpdateNodeTextWidth(InternalNode* node) {
661 int width = 0, height = 0; 661 int width = 0, height = 0;
662 gfx::Canvas::SizeStringInt(node->model_node()->GetTitle(), 662 gfx::Canvas::SizeStringInt(node->model_node()->GetTitle(), font_,
663 font_, &width, &height, gfx::Canvas::NO_ELLIPSIS); 663 &width, &height, 0, gfx::Canvas::NO_ELLIPSIS);
664 node->set_text_width(width); 664 node->set_text_width(width);
665 } 665 }
666 666
667 void TreeView::DrawnNodesChanged() { 667 void TreeView::DrawnNodesChanged() {
668 UpdatePreferredSize(); 668 UpdatePreferredSize();
669 PreferredSizeChanged(); 669 PreferredSizeChanged();
670 SchedulePaint(); 670 SchedulePaint();
671 } 671 }
672 672
673 void TreeView::UpdatePreferredSize() { 673 void TreeView::UpdatePreferredSize() {
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 if (!is_expanded_) 998 if (!is_expanded_)
999 return max_width; 999 return max_width;
1000 for (int i = 0; i < child_count(); ++i) { 1000 for (int i = 0; i < child_count(); ++i) {
1001 max_width = std::max(max_width, 1001 max_width = std::max(max_width,
1002 GetChild(i)->GetMaxWidth(indent, depth + 1)); 1002 GetChild(i)->GetMaxWidth(indent, depth + 1));
1003 } 1003 }
1004 return max_width; 1004 return max_width;
1005 } 1005 }
1006 1006
1007 } // namespace views 1007 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/label.cc ('k') | ui/views/view_text_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698