macos: redo all the split views

This commit is contained in:
Mitchell Hashimoto
2023-03-08 22:14:29 -08:00
parent 0388dc35bb
commit 31378bcaa5
4 changed files with 124 additions and 112 deletions

View File

@@ -7,7 +7,7 @@ import SwiftUI
/// as time goes on. For example, the splitter divider size and styling is all hardcoded.
struct SplitView<L: View, R: View>: View {
/// Direction of the split
let direction: Direction
let direction: SplitViewDirection
/// The left and right views to render.
let left: L
@@ -41,7 +41,7 @@ struct SplitView<L: View, R: View>: View {
}
}
init(_ direction: Direction, @ViewBuilder left: (() -> L), @ViewBuilder right: (() -> R)) {
init(_ direction: SplitViewDirection, @ViewBuilder left: (() -> L), @ViewBuilder right: (() -> R)) {
self.direction = direction
self.left = left()
self.right = right()
@@ -114,8 +114,6 @@ struct SplitView<L: View, R: View>: View {
}
}
extension SplitView {
enum Direction {
case horizontal, vertical
}
enum SplitViewDirection {
case horizontal, vertical
}