Skip to content

Commit 7e20e55

Browse files
committed
fix: restore working collapse/expand for inspector panel split view
1 parent 037a9e4 commit 7e20e55

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

TablePro/Views/Components/HorizontalSplitView.swift

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,20 @@ struct HorizontalSplitView<Leading: View, Trailing: View>: NSViewRepresentable {
5959

6060
if isTrailingCollapsed != wasCollapsed {
6161
context.coordinator.lastCollapsedState = isTrailingCollapsed
62-
NSAnimationContext.runAnimationGroup { ctx in
63-
ctx.duration = 0.2
64-
ctx.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)
65-
ctx.allowsImplicitAnimation = true
66-
67-
if isTrailingCollapsed {
68-
if splitView.subviews.count >= 2 {
69-
context.coordinator.savedDividerPosition = splitView.subviews[1].frame.width
70-
}
71-
splitView.setPosition(splitView.bounds.width, ofDividerAt: 0)
72-
trailingView.isHidden = true
73-
} else {
74-
trailingView.isHidden = false
75-
splitView.adjustSubviews()
76-
if let saved = context.coordinator.savedDividerPosition {
77-
splitView.setPosition(splitView.bounds.width - saved, ofDividerAt: 0)
78-
}
62+
if isTrailingCollapsed {
63+
if splitView.subviews.count >= 2 {
64+
context.coordinator.savedDividerPosition = splitView.subviews[1].frame.width
7965
}
66+
splitView.setPosition(splitView.bounds.width, ofDividerAt: 0)
67+
trailingView.isHidden = true
68+
splitView.display()
69+
} else {
70+
trailingView.isHidden = false
71+
splitView.adjustSubviews()
72+
if let saved = context.coordinator.savedDividerPosition {
73+
splitView.setPosition(splitView.bounds.width - saved, ofDividerAt: 0)
74+
}
75+
splitView.display()
8076
}
8177
}
8278
}

0 commit comments

Comments
 (0)