mirror of https://github.com/buggins/dlangui.git
expand all / collapse all - fix #448
This commit is contained in:
parent
047b412e3c
commit
f55d72c5a5
|
@ -185,6 +185,24 @@ class TreeItem {
|
||||||
void collapse() {
|
void collapse() {
|
||||||
_expanded = false;
|
_expanded = false;
|
||||||
}
|
}
|
||||||
|
/// expand this node and all children
|
||||||
|
void expandAll() {
|
||||||
|
foreach(c; _children) {
|
||||||
|
if (!c._expanded && c.canCollapse) //?
|
||||||
|
c.expandAll();
|
||||||
|
}
|
||||||
|
if (!expanded)
|
||||||
|
toggleExpand(this);
|
||||||
|
}
|
||||||
|
/// expand this node and all children
|
||||||
|
void collapseAll() {
|
||||||
|
foreach(c; _children) {
|
||||||
|
if (c._expanded && c.canCollapse)
|
||||||
|
c.collapseAll();
|
||||||
|
}
|
||||||
|
if (expanded)
|
||||||
|
toggleExpand(this);
|
||||||
|
}
|
||||||
|
|
||||||
@property TreeItem selectedItem() {
|
@property TreeItem selectedItem() {
|
||||||
return root.selectedItem();
|
return root.selectedItem();
|
||||||
|
|
Loading…
Reference in New Issue