Prevent unfolding of nodes without children
This commit is contained in:
parent
909d587c53
commit
573a835022
4 changed files with 20 additions and 8 deletions
|
|
@ -34,7 +34,7 @@ narrowDrawState nodeId ds = ds
|
|||
nodeToWidget :: Bool -> Node -> Widget ResourceName
|
||||
nodeToWidget focused node =
|
||||
let nodeWidget = txt $ nodeText node
|
||||
expandStyle = if null (nodeChildren node) then "noexpand" else "expand"
|
||||
expandStyle = if hasChildren node then "expand" else "noexpand"
|
||||
focusStyle = if focused then "focus" else "nofocus"
|
||||
in withDefAttr focusStyle $ withDefAttr expandStyle nodeWidget
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue