mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: use my new split view
This commit is contained in:
@ -108,12 +108,13 @@ extension Ghostty {
|
|||||||
Button("Close Right") { closeBottomRight() }
|
Button("Close Right") { closeBottomRight() }
|
||||||
}
|
}
|
||||||
|
|
||||||
HSplitView {
|
SplitView(.horizontal, left: {
|
||||||
SplitViewChild(app, topLeft: state.topLeft)
|
SplitViewChild(app, topLeft: state.topLeft)
|
||||||
.focused($focusedSide, equals: .TopLeft)
|
.focused($focusedSide, equals: .TopLeft)
|
||||||
|
}, right: {
|
||||||
SplitViewChild(app, topLeft: state.bottomRight!)
|
SplitViewChild(app, topLeft: state.bottomRight!)
|
||||||
.focused($focusedSide, equals: .BottomRight)
|
.focused($focusedSide, equals: .BottomRight)
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
case .vertical:
|
case .vertical:
|
||||||
VStack {
|
VStack {
|
||||||
@ -122,12 +123,13 @@ extension Ghostty {
|
|||||||
Button("Close Bottom") { closeBottomRight() }
|
Button("Close Bottom") { closeBottomRight() }
|
||||||
}
|
}
|
||||||
|
|
||||||
VSplitView {
|
SplitView(.vertical, left: {
|
||||||
SplitViewChild(app, topLeft: state.topLeft)
|
SplitViewChild(app, topLeft: state.topLeft)
|
||||||
.focused($focusedSide, equals: .TopLeft)
|
.focused($focusedSide, equals: .TopLeft)
|
||||||
|
}, right: {
|
||||||
SplitViewChild(app, topLeft: state.bottomRight!)
|
SplitViewChild(app, topLeft: state.bottomRight!)
|
||||||
.focused($focusedSide, equals: .BottomRight)
|
.focused($focusedSide, equals: .BottomRight)
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,15 +21,8 @@ struct GhosttyApp: App {
|
|||||||
case .error:
|
case .error:
|
||||||
ErrorView()
|
ErrorView()
|
||||||
case .ready:
|
case .ready:
|
||||||
SplitView(.vertical, left: {
|
Ghostty.TerminalSplitView()
|
||||||
Color.green
|
.ghosttyApp(ghostty.app!)
|
||||||
}, right: {
|
|
||||||
Color.red
|
|
||||||
})
|
|
||||||
/*
|
|
||||||
Ghostty.Terminal()
|
|
||||||
.ghosttyApp(ghostty.app!)
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}.commands {
|
}.commands {
|
||||||
CommandGroup(after: .newItem) {
|
CommandGroup(after: .newItem) {
|
||||||
|
@ -5,8 +5,8 @@ struct SplitView<L: View, R: View>: View {
|
|||||||
let left: L
|
let left: L
|
||||||
let right: R
|
let right: R
|
||||||
|
|
||||||
private let splitterVisibleSize: CGFloat = 2
|
private let splitterVisibleSize: CGFloat = 1
|
||||||
private let splitterInvisibleSize: CGFloat = 5
|
private let splitterInvisibleSize: CGFloat = 6
|
||||||
|
|
||||||
@State var split: CGFloat = 0.5
|
@State var split: CGFloat = 0.5
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user