Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Sources/SwiftTerm/Mac/MacTerminalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,14 @@ open class TerminalView: NSView, NSTextInputClient, NSUserInterfaceValidations,

func setupScroller()
{
if scroller != nil {
scroller.removeFromSuperview()
Comment on lines -306 to -307

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a workaround for the scroller not responding to frame updates. Without re-adding the scroller, it does not layout properly. I introduced the workarond here #362
Now when it is reverted, the previous problem reappeared.

}

let style: NSScroller.Style = .legacy
let scrollerWidth = NSScroller.scrollerWidth(for: .regular, scrollerStyle: style)
scroller = NSScroller(frame: NSRect(x: bounds.maxX - scrollerWidth, y: 0, width: scrollerWidth, height: bounds.height))
let scrollerFrame = NSRect(x: bounds.maxX - scrollerWidth, y: 0, width: scrollerWidth, height: bounds.height)
if scroller == nil {
scroller = NSScroller(frame: scrollerFrame)
} else {
scroller?.frame = scrollerFrame
}
scroller.autoresizingMask = [.minXMargin, .height]
scroller.scrollerStyle = style
scroller.knobProportion = 0.1
Expand Down
Loading