Skip to content

Commit

Permalink
Remove InitialNodeStatus from LazyTree usage
Browse files Browse the repository at this point in the history
  • Loading branch information
fscarponi committed Sep 13, 2023
1 parent 8d8ac6a commit c378349
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
3 changes: 0 additions & 3 deletions core/src/main/kotlin/org/jetbrains/jewel/LazyTree.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import androidx.compose.ui.res.ResourceLoader
import org.jetbrains.jewel.foundation.lazy.SelectableLazyItemScope
import org.jetbrains.jewel.foundation.tree.BasicLazyTree
import org.jetbrains.jewel.foundation.tree.DefaultTreeViewKeyActions
import org.jetbrains.jewel.foundation.tree.InitialNodeStatus
import org.jetbrains.jewel.foundation.tree.KeyBindingActions
import org.jetbrains.jewel.foundation.tree.Tree
import org.jetbrains.jewel.foundation.tree.TreeElementState
Expand All @@ -21,7 +20,6 @@ import org.jetbrains.jewel.styling.LazyTreeStyle
@Composable
fun <T> LazyTree(
tree: Tree<T>,
initialNodeStatus: InitialNodeStatus = InitialNodeStatus.Close,
resourceLoader: ResourceLoader,
modifier: Modifier = Modifier,
onElementClick: (Tree.Element<T>) -> Unit = {},
Expand All @@ -36,7 +34,6 @@ fun <T> LazyTree(
val metrics = style.metrics
BasicLazyTree(
tree = tree,
initialNodeStatus = initialNodeStatus,
onElementClick = onElementClick,
elementBackgroundFocused = colors.elementBackgroundFocused,
elementBackgroundSelectedFocused = colors.elementBackgroundSelectedFocused,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CornerSize
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.Stable
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -75,7 +74,6 @@ import kotlin.time.Duration.Companion.milliseconds
@Composable
fun <T> BasicLazyTree(
tree: Tree<T>,
initialNodeStatus: InitialNodeStatus,
selectionMode: SelectionMode = SelectionMode.Multiple,
onElementClick: (Tree.Element<T>) -> Unit,
elementBackgroundFocused: Color,
Expand Down Expand Up @@ -114,14 +112,6 @@ fun <T> BasicLazyTree(
}
}

DisposableEffect(tree, treeState.allNodes.size) {
if (initialNodeStatus == InitialNodeStatus.Open) {
treeState.openNodes.clear()
treeState.openNodes.addAll(treeState.allNodes.map { it.first })
}
onDispose { }
}

SelectableLazyColumn(
modifier = modifier,
state = treeState.delegate,
Expand Down

0 comments on commit c378349

Please sign in to comment.