@@ -48,7 +48,6 @@ struct EditorLayoutView: View {
4848
4949 struct SubEditorLayoutView : View {
5050 @ObservedObject var data : SplitViewData
51-
5251 @FocusState . Binding var focus : Editor ?
5352
5453 var body : some View {
@@ -58,15 +57,33 @@ struct EditorLayoutView: View {
5857 . edgesIgnoringSafeArea ( [ . top, . bottom] )
5958 }
6059
61- var splitView : some View {
62- ForEach ( Array ( data. editorLayouts. enumerated ( ) ) , id: \. offset) { index, item in
60+ func stackContentsView( index: Int , item: EditorLayout ) -> some View {
61+ Group {
62+ // Add a divider before the editor if it's not the first
63+ if index != 0 { PanelDivider ( ) }
6364 EditorLayoutView ( layout: item, focus: $focus)
6465 . transformEnvironment ( \. isAtEdge) { belowToolbar in
6566 calcIsAtEdge ( current: & belowToolbar, index: index)
6667 }
6768 . environment ( \. splitEditor) { [ weak data] edge, newEditor in
6869 data? . split ( edge, at: index, new: newEditor)
6970 }
71+ // Add a divider after the editor if it's not the last
72+ if index != data. editorLayouts. count - 1 { PanelDivider ( ) }
73+ }
74+ }
75+
76+ var splitView : some View {
77+ ForEach ( Array ( data. editorLayouts. enumerated ( ) ) , id: \. offset) { index, item in
78+ if data. axis == . horizontal {
79+ HStack ( spacing: 0 ) {
80+ stackContentsView ( index: index, item: item)
81+ }
82+ } else {
83+ VStack ( spacing: 0 ) {
84+ stackContentsView ( index: index, item: item)
85+ }
86+ }
7087 }
7188 }
7289
0 commit comments