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