Property editor minor refactoring
This commit is contained in:
parent
30f6d51745
commit
067ed4aa3d
@ -31,7 +31,6 @@ public sealed class EditorPropertyState {
|
||||
public data object Defined : EditorPropertyState()
|
||||
public data class Default(public val source: String = "unknown") : EditorPropertyState()
|
||||
public data object Undefined : EditorPropertyState()
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -44,8 +43,8 @@ public fun PropertyEditor(
|
||||
rootMeta: MutableMeta,
|
||||
getPropertyState: (Name) -> EditorPropertyState,
|
||||
updates: Flow<Name>,
|
||||
name: Name = Name.EMPTY,
|
||||
rootDescriptor: MetaDescriptor? = null,
|
||||
name: Name,
|
||||
rootDescriptor: MetaDescriptor?,
|
||||
initialExpanded: Boolean? = null,
|
||||
) {
|
||||
var expanded: Boolean by remember { mutableStateOf(initialExpanded ?: true) }
|
||||
@ -97,9 +96,13 @@ public fun PropertyEditor(
|
||||
}
|
||||
Span({
|
||||
classes(TreeStyles.treeLabel)
|
||||
if (editorPropertyState != EditorPropertyState.Defined) {
|
||||
when (editorPropertyState) {
|
||||
is EditorPropertyState.Default, EditorPropertyState.Undefined -> {
|
||||
classes(TreeStyles.treeLabelInactive)
|
||||
}
|
||||
|
||||
EditorPropertyState.Defined -> {}
|
||||
}
|
||||
}) {
|
||||
Text(token)
|
||||
}
|
||||
|
@ -148,6 +148,7 @@ public fun ThreeView(
|
||||
EditorPropertyState.Undefined
|
||||
}
|
||||
},
|
||||
name = Name.EMPTY,
|
||||
updates = vision.properties.changes,
|
||||
rootDescriptor = vision.descriptor
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user