Give instruments that have hooks a disclosure chevron and persist the per-instrument collapsed state in the session UI state. Toggle the module and thread groups on a full header-row click. Pad the module view so its tabs clear the top-left edge.
55 lines
1.3 KiB
Swift
55 lines
1.3 KiB
Swift
import SwiftUI
|
|
import LumaCore
|
|
|
|
protocol InstrumentUI {
|
|
func makeConfigEditor(
|
|
configJSON: Binding<Data>,
|
|
engine: Engine,
|
|
selection: Binding<SidebarItemID?>
|
|
) -> AnyView
|
|
|
|
func renderEvent(
|
|
_ event: RuntimeEvent,
|
|
engine: Engine,
|
|
selection: Binding<SidebarItemID?>
|
|
) -> AnyView
|
|
|
|
func makeEventContextMenuItems(
|
|
_ event: RuntimeEvent,
|
|
engine: Engine,
|
|
selection: Binding<SidebarItemID?>
|
|
) -> [InstrumentEventMenuItem]
|
|
|
|
func sidebarChildren(
|
|
sessionID: UUID,
|
|
instance: LumaCore.InstrumentInstance,
|
|
engine: Engine,
|
|
selection: Binding<SidebarItemID?>
|
|
) -> AnyView
|
|
|
|
func hasSidebarChildren(instance: LumaCore.InstrumentInstance) -> Bool
|
|
}
|
|
|
|
extension InstrumentUI {
|
|
func makeEventContextMenuItems(
|
|
_ event: RuntimeEvent,
|
|
engine: Engine,
|
|
selection: Binding<SidebarItemID?>
|
|
) -> [InstrumentEventMenuItem] {
|
|
[]
|
|
}
|
|
|
|
func sidebarChildren(
|
|
sessionID: UUID,
|
|
instance: LumaCore.InstrumentInstance,
|
|
engine: Engine,
|
|
selection: Binding<SidebarItemID?>
|
|
) -> AnyView {
|
|
AnyView(EmptyView())
|
|
}
|
|
|
|
func hasSidebarChildren(instance: LumaCore.InstrumentInstance) -> Bool {
|
|
false
|
|
}
|
|
}
|