File tree Expand file tree Collapse file tree 4 files changed +9
-3
lines changed
workflow-trace-viewer/src/jvmMain
kotlin/com/squareup/workflow1/traceviewer Expand file tree Collapse file tree 4 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import io.github.vinceglb.filekit.dialogs.FileKitType
23
23
import io.github.vinceglb.filekit.dialogs.compose.rememberFilePickerLauncher
24
24
import io.github.vinceglb.filekit.readString
25
25
26
+
26
27
@Composable
27
28
public fun App () {
28
29
Box {
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.Box
7
7
import androidx.compose.foundation.layout.Column
8
8
import androidx.compose.foundation.layout.Row
9
9
import androidx.compose.foundation.layout.Spacer
10
+ import androidx.compose.foundation.layout.fillMaxSize
10
11
import androidx.compose.foundation.layout.padding
11
12
import androidx.compose.material.Text
12
13
import androidx.compose.runtime.Composable
@@ -43,19 +44,23 @@ public data class WorkflowNode (
43
44
44
45
/* *
45
46
* Since the workflow nodes present a tree structure, we utilize a recursive function to draw the tree
46
- *
47
+ * The Column holds a subtree of nodes, and the Row holds all the children of the current node
47
48
*/
48
49
@Composable
49
50
public fun DrawWorkflowTree (
50
51
node : WorkflowNode ,
51
52
) {
52
53
Column (
53
- modifier = Modifier .padding(10 .dp).border(1 .dp,Color .Black ),
54
+ modifier = Modifier
55
+ .padding(5 .dp)
56
+ .border(1 .dp,Color .Black )
57
+ .fillMaxSize(),
54
58
horizontalAlignment = Alignment .CenterHorizontally ,
55
59
) {
60
+ // draws itself
56
61
drawNode(node)
57
- if (node.children.isEmpty()) return @Column
58
62
63
+ // draws children recursively
59
64
Row (
60
65
horizontalArrangement = Arrangement .Center ,
61
66
verticalAlignment = Alignment .Top
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments