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

Unified Diff: views/controls/tree/tree_view.h

Issue 399030: Add an option to tree_view for whether to show lines from the root node... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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
« no previous file with comments | « chrome/browser/views/options/cookies_view.cc ('k') | views/controls/tree/tree_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/tree/tree_view.h
===================================================================
--- views/controls/tree/tree_view.h (revision 31645)
+++ views/controls/tree/tree_view.h (working copy)
@@ -57,10 +57,27 @@
void SetModel(TreeModel* model);
TreeModel* model() const { return model_; }
+ // Sets whether to automatically expand children when a parent node is
+ // expanded. The default is false. If true, when a node in the tree is
+ // expanded for the first time, its children are also automatically expanded.
+ // If a node is subsequently collapsed and expanded again, the children
+ // will not be automatically expanded.
+ void set_auto_expand_children(bool auto_expand_children) {
+ auto_expand_children_ = auto_expand_children;
+ }
+
// Sets whether the user can edit the nodes. The default is true. If true,
// the Controller is queried to determine if a particular node can be edited.
void SetEditable(bool editable);
+ // Sets whether lines are drawn from the root node to child nodes (and
+ // whether plus boxes show up next to the root node.) The default is false.
+ // If root_shown_ is false, the children of the root act as the roots in the
+ // native control, and so this setting takes effect for them.
+ void set_lines_at_root(bool lines_at_root) {
+ lines_at_root_ = lines_at_root;
+ }
+
// Edits the specified node. This cancels the current edit and expands
// all parents of node.
void StartEditing(TreeModelNode* node);
@@ -257,11 +274,14 @@
TreeModel* model_;
// Maps from id to NodeDetails.
- std::map<int,NodeDetails*> id_to_details_map_;
+ std::map<int, NodeDetails*> id_to_details_map_;
// Maps from model entry to NodeDetails.
- std::map<TreeModelNode*,NodeDetails*> node_to_details_map_;
+ std::map<TreeModelNode*, NodeDetails*> node_to_details_map_;
+ // Whether to automatically expand children when a parent node is expanded.
+ bool auto_expand_children_;
+
// Whether the user can edit the items.
bool editable_;
@@ -277,6 +297,9 @@
// Whether or not the root is shown in the tree.
bool root_shown_;
+ // Whether lines are drawn from the root to the children.
+ bool lines_at_root_;
+
// Whether enter should be processed by the tree when not editing.
bool process_enter_;
« no previous file with comments | « chrome/browser/views/options/cookies_view.cc ('k') | views/controls/tree/tree_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698