Class: TreeBranch

ui.TreeBranch

new ui.TreeBranch ()

Element representing a tree branch for showing a tree node in a list view.

This element may, for instance, be used in the delegate of a html.ListView with a core.TreeModelAdapter as model for adding a tree view UI.

Example:

ListView {
   fill: true

   model: treeModel
   cellWidth: bboxWidth
   cellHeight: theme.itemHeightSmall

   delegate: template Box {
       layout: "center-row"

       TreeBranch {
              fillHeight: true
           level: modelData.value.level
           nodeStatus: modelData.value.nodeStatus
           nodeType: modelData.value.nodeType
       }

       Label {
           marginLeft: theme.paddingSmall
           text: modelData.value.text
       }
   }
}
Properties:
Name Type Description
branchLines bool

(default: true) Whether to show the branch lines.

branchLinesColor core.Color

(default: theme.borderColor) The color of the branch lines.

collapsedIcon string

(default: "core-arrow_right") The icon to use for collapsed non-leaf nodes.

iconColor core.Color

(default: theme.borderColor) The color of the icon.

leafIcon string

(default: "core-file-empty") The icon to use for leaf nodes.

level number

(default: 0) The depth level of this node.

nodeStatus object

(default: { }) The node status object for this node.

nodeType string

(default: node) The type of this node. One of node|leaf

uncollapsedIcon string

(default: "core-arrow_down") The icon to use for uncollapsed non-leaf nodes.

Extends

Events

Is triggered when the user clicked the collapse/uncollapse button.

Name Type Description
event html.MouseBox.PointerEvent

The pointer event of the click.