CtlPrefWindow // Compatibility with vintage macOS versions.
This commit is contained in:
parent
133901ede2
commit
e5591ef9cc
|
@ -498,23 +498,10 @@ extension CtlPrefWindow: NSToolbarDelegate {
|
||||||
let temporaryViewOld = NSView(frame: existingContentView.frame)
|
let temporaryViewOld = NSView(frame: existingContentView.frame)
|
||||||
window.contentView = temporaryViewOld
|
window.contentView = temporaryViewOld
|
||||||
var newWindowRect = NSRect(origin: window.frame.origin, size: newView.bounds.size)
|
var newWindowRect = NSRect(origin: window.frame.origin, size: newView.bounds.size)
|
||||||
let shouldScroll: Bool = newWindowRect.size.height > 577
|
|
||||||
if shouldScroll { newWindowRect.size.height = 577 }
|
|
||||||
newWindowRect.size.height += kWindowTitleHeight
|
newWindowRect.size.height += kWindowTitleHeight
|
||||||
newWindowRect.origin.y = window.frame.maxY - newWindowRect.height
|
newWindowRect.origin.y = window.frame.maxY - newWindowRect.height
|
||||||
window.setFrame(newWindowRect, display: true, animate: animate)
|
window.setFrame(newWindowRect, display: true, animate: animate)
|
||||||
if shouldScroll {
|
window.contentView = newView
|
||||||
let scrollview = NSScrollView(frame: NSRect(x: 0, y: 0, width: 577, height: 577))
|
|
||||||
scrollview.borderType = .noBorder
|
|
||||||
scrollview.hasVerticalScroller = true
|
|
||||||
scrollview.hasHorizontalScroller = false
|
|
||||||
scrollview.verticalScroller?.scrollerStyle = .legacy
|
|
||||||
scrollview.autoresizingMask = [.width, .height]
|
|
||||||
scrollview.documentView = newView
|
|
||||||
window.contentView = scrollview
|
|
||||||
} else {
|
|
||||||
window.contentView = newView
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var toolbarIdentifiers: [NSToolbarItem.Identifier] {
|
var toolbarIdentifiers: [NSToolbarItem.Identifier] {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue