Fix split pane orientations
- Cmd+D now correctly creates vertical split (side-by-side) - Cmd+Shift+D creates horizontal split (top-bottom) - Recreates split view if changing orientation - Clear distinction between the two split types
This commit is contained in:
Binary file not shown.
@@ -543,10 +543,18 @@ class MainWindowController: NSWindowController {
|
|||||||
@objc func splitPaneVertically() {
|
@objc func splitPaneVertically() {
|
||||||
guard let currentSession = tabManager.getCurrentSession() else { return }
|
guard let currentSession = tabManager.getCurrentSession() else { return }
|
||||||
|
|
||||||
|
// If split view exists with wrong orientation, recreate it
|
||||||
|
if let existing = splitView, !existing.isVertical {
|
||||||
|
// Remove and recreate with correct orientation
|
||||||
|
existing.removeFromSuperview()
|
||||||
|
splitView = nil
|
||||||
|
panes = []
|
||||||
|
}
|
||||||
|
|
||||||
// Create split view if it doesn't exist
|
// Create split view if it doesn't exist
|
||||||
if splitView == nil {
|
if splitView == nil {
|
||||||
splitView = NSSplitView(frame: contentView.bounds)
|
splitView = NSSplitView(frame: contentView.bounds)
|
||||||
splitView?.isVertical = true
|
splitView?.isVertical = true // Side-by-side (vertical divider)
|
||||||
splitView?.dividerStyle = .thin
|
splitView?.dividerStyle = .thin
|
||||||
splitView?.autoresizingMask = [.width, .height]
|
splitView?.autoresizingMask = [.width, .height]
|
||||||
|
|
||||||
@@ -577,10 +585,18 @@ class MainWindowController: NSWindowController {
|
|||||||
@objc func splitPaneHorizontally() {
|
@objc func splitPaneHorizontally() {
|
||||||
guard let currentSession = tabManager.getCurrentSession() else { return }
|
guard let currentSession = tabManager.getCurrentSession() else { return }
|
||||||
|
|
||||||
|
// If split view exists with wrong orientation, recreate it
|
||||||
|
if let existing = splitView, existing.isVertical {
|
||||||
|
// Remove and recreate with correct orientation
|
||||||
|
existing.removeFromSuperview()
|
||||||
|
splitView = nil
|
||||||
|
panes = []
|
||||||
|
}
|
||||||
|
|
||||||
// Create split view if it doesn't exist
|
// Create split view if it doesn't exist
|
||||||
if splitView == nil {
|
if splitView == nil {
|
||||||
splitView = NSSplitView(frame: contentView.bounds)
|
splitView = NSSplitView(frame: contentView.bounds)
|
||||||
splitView?.isVertical = false
|
splitView?.isVertical = false // Top-bottom (horizontal divider)
|
||||||
splitView?.dividerStyle = .thin
|
splitView?.dividerStyle = .thin
|
||||||
splitView?.autoresizingMask = [.width, .height]
|
splitView?.autoresizingMask = [.width, .height]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user